Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2005

Tip: Looking for answers? Try searching our database.

template + page numbers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
someday - 13 Jan 2005 00:23 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.