+ Reply to Thread
Results 1 to 2 of 2

coding for footer,help please

  1. #1
    kathy
    Guest

    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. #2
    Tom Ogilvy
    Guest

    Re: coding for footer,help please

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

    --
    Regards,
    Tom Ogilvy


    "kathy" <[email protected]> wrote in message
    news:[email protected]...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1