D
DawnTreader
i have found a little routine that almost does what i want here:
http://www.microsoft.com/office/com...5298&catlist=&dglist=&ptlist=&exp=&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.
http://www.microsoft.com/office/com...5298&catlist=&dglist=&ptlist=&exp=&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.