Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default coding for footer,help please

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default coding for footer,help please

You have to group your sheets before printing to get sequential numbers
across worksheets.

--
Regards,
Tom Ogilvy


"kathy" wrote in message
oups.com...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel footer to look like Word footer? Carole O Excel Discussion (Misc queries) 5 June 2nd 08 11:25 PM
Coding metaltecks Excel Discussion (Misc queries) 1 April 17th 06 10:12 PM
"=ROW()-1" type of coding doesn't appear in a filter / is there coding that does? StargateFan[_3_] Excel Programming 10 October 6th 05 01:18 PM
Implant macro coding into ASP coding Sam yong Excel Programming 5 September 15th 05 10:37 AM
Landscape Orientation when Footer set using mso-footer-data Disappear Vish[_2_] Excel Programming 0 November 14th 03 09:28 PM


All times are GMT +1. The time now is 07:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"