Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    May 2003
    Location
    Sacramento, California, USA
    Posts
    310
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Headers (Excel 2k)

    I know there is a way to do this, but I'm stumped! How can I print the header only on the first page of a multiple page doc???

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Headers (Excel 2k)

    This macro is from Excel MVP Ron de Bruin. Adapt the code to set the first page header to your needs (in the example, LeftHeader and CenterHeader are set; you can also set RightHeader)

    Sub Print_Header()
    ' Will print header on 1st page only
    ' By: Ron de Bruin
    Dim TotPage As Long
    TotPage = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
    With ActiveSheet.PageSetup
    .LeftHeader = "test"
    .CenterHeader = ActiveSheet.Range("A1")
    ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1
    .LeftHeader = ""
    .CenterHeader = ""
    ActiveWindow.SelectedSheets.PrintOut From:=2, To:=TotPage
    End With
    End Sub

Posting Permissions

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