Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i have found a little routine that almost does what i want he
http://www.microsoft.com/office/comm...xp=&sloc=en-us but what i need is for it to print one page and then the next page after updating that cell. here is the code that i borrowed from that thread: Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim AnySheet As Worksheet Dim myRange As Range Dim CellRange As Object For Each AnySheet In ActiveWindow.SelectedSheets 'change "Sheet1" to actual sheet name If AnySheet.Name = "Sheet1" Then Set myRange = AnySheet.Range("I7") For Each CellRange In myRange CellRange.Value = CellRange.Value + 1 Next End If Next 'delete the next line to 'actually let it print out 'this is here just for testing 'Cancel = True End Sub it works in incrementing the cell, but it doesnt print the first page then update the cell and print the second. basically i need this for an invoice where the page number is located in the middle of the page rather than in the header or footer. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to display current page number in any cell of that page. | Excel Discussion (Misc queries) | |||
sheet tabs as page number and in a cell page of pages? | Excel Discussion (Misc queries) | |||
macro adding a number to a number already in a cell | Excel Programming | |||
macro adding a number to a number already in a cell | Excel Programming | |||
macro adding a number to a number already in a cell | Excel Programming |