K
kathy
Hello,
I have 120 worksheets in one excel file.
I set print area in some sheets, some not.
I use macro to set up footer. Page number for the first 25 is right.
Then the next page number becomes 4,5,6,7...... ..
After several correct sequent pages, the
page number is wrong again. And repeat this again and again.....
Any comments?? Thanks.
Code is following:
Public Sub tester()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws.PageSetup
.LeftHeader = "&A"
.LeftFooter = "Page &P of &N"
End With
Next ws
End Sub
I have 120 worksheets in one excel file.
I set print area in some sheets, some not.
I use macro to set up footer. Page number for the first 25 is right.
Then the next page number becomes 4,5,6,7...... ..
After several correct sequent pages, the
page number is wrong again. And repeat this again and again.....
Any comments?? Thanks.
Code is following:
Public Sub tester()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws.PageSetup
.LeftHeader = "&A"
.LeftFooter = "Page &P of &N"
End With
Next ws
End Sub