Increment cell number when printing

  • Thread starter Thread starter goody
  • Start date Start date
G

goody

I would like a particular cell in my spreadsheet to be incremented b
the value of one after I have printed the worksheet. Any ideas on ho
I can achieve this?

Thanks
Goody
 
Hi
the following increments the cell before printing (put it in your
workbook module - not in a
standard module). It will increment cell A1 on sheet1:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
worksheets("Sheet1").Range("A1").value = _
worksheets("Sheet1").Range("A1").value + 1
End Sub
 
Thanks Frank. I want to execute the code when I click a button on th
toolbar, any ideas on how I can do this?

Thanks
Goody
 
Hi
the just assign the following macro to a button:
sub increment()
worksheets("Sheet1").Range("A1").value = _
worksheets("Sheet1").Range("A1").value + 1
end sub
 
Back
Top