I have a template with a cell reserved for the page number. I need to print
the template 200 times with the page number incrementing for each page
printed.
In other words, the first page printed to read 1, second page 2, the third
3, etc.
How can I get this cell to increment 1 for each page printed.
Thank you in advance.
Nick Hodge - 13 Jan 2005 00:29 GMT
You could use the workbook_beforeprint() event to increment the cell
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Worksheets("Sheet1").Range("A1").Value = _
Worksheets("Sheet1").Range("A1").Value + 1
End Sub
See here for implementation
http://www.nickhodge.co.uk/vba/vbaimplement.htm#EventCode

Signature
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS
>I have a template with a cell reserved for the page number. I need to
>print the template 200 times with the page number incrementing for each
[quoted text clipped - 6 lines]
>
> Thank you in advance.