+ Reply to Thread
Results 1 to 4 of 4

Setting sheet names as headers with page numbering

  1. #1
    KimberlyC
    Guest

    Setting sheet names as headers with page numbering

    Hi
    Is there a way (before I print the activeworkbook) to set the header of each
    worksheet in my workbook to the sheet's name plus the [page] number?

    There can be many sheets in the activeworkbook with different names.... and
    with many pages that print on each sheet (that's why I need the page number
    at the end of each sheet's name in the header).

    Any help on this would be greatly appreciated!!
    Thanks in advance
    Kimberly




  2. #2
    Jef Gorbach
    Guest

    Re: Setting sheet names as headers with page numbering


    "KimberlyC" <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    > Is there a way (before I print the activeworkbook) to set the header of

    each
    > worksheet in my workbook to the sheet's name plus the [page] number?
    >
    > There can be many sheets in the activeworkbook with different names....

    and
    > with many pages that print on each sheet (that's why I need the page

    number
    > at the end of each sheet's name in the header).
    >
    > Any help on this would be greatly appreciated!!
    > Thanks in advance
    > Kimberly
    >
    >
    >


    try this:

    Sub title_pages()
    'change month in center heading before running
    For i = 1 To Sheets.Count
    With Sheets(i).PageSetup
    .LeftHeader = ""
    .CenterHeader = _
    "Company Name" & Chr(10) _
    & "&A" & Chr(10) _
    & Format(DateSerial(Year(Now), Month(Now) - 1, 1), "mmm-yyyy")
    .RightHeader = ""
    .LeftFooter = ""
    .CenterFooter = "Page &P of &N"
    .RightFooter = ""
    End With
    Next i
    End Sub



  3. #3
    Gord Dibben
    Guest

    Re: Setting sheet names as headers with page numbering

    Kimberly

    Sub Name_in_Header()
    For i = 1 To Sheets.Count
    With Sheets(i).PageSetup
    .CenterHeader = Sheets(i).Name & " Page &P"
    End With
    Next i
    End Sub


    Gord Dibben Excel MVP

    On Wed, 11 May 2005 13:39:55 -0700, "KimberlyC" <[email protected]>
    wrote:

    >Hi
    >Is there a way (before I print the activeworkbook) to set the header of each
    >worksheet in my workbook to the sheet's name plus the [page] number?
    >
    >There can be many sheets in the activeworkbook with different names.... and
    >with many pages that print on each sheet (that's why I need the page number
    >at the end of each sheet's name in the header).
    >
    >Any help on this would be greatly appreciated!!
    >Thanks in advance
    >Kimberly
    >
    >



  4. #4
    KimberlyC
    Guest

    Re: Setting sheet names as headers with page numbering

    Thank you!!
    They both work well!!
    "KimberlyC" <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    > Is there a way (before I print the activeworkbook) to set the header of

    each
    > worksheet in my workbook to the sheet's name plus the [page] number?
    >
    > There can be many sheets in the activeworkbook with different names....

    and
    > with many pages that print on each sheet (that's why I need the page

    number
    > at the end of each sheet's name in the header).
    >
    > Any help on this would be greatly appreciated!!
    > Thanks in advance
    > Kimberly
    >
    >
    >




+ 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