coding for footer

K

kathy

I have 120 worksheets in one 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top