Consulting

Results 1 to 2 of 2

Thread: Different footer for each page of a sheet

  1. #1
    VBAX Newbie
    Joined
    Nov 2012
    Posts
    1
    Location

    Different footer for each page of a sheet

    Hi everybody,

    Could anybody give me any advice? There are some pages in a sheet, but I don't know how to set different footers for each page of the sheet. For example, in page 1,2,3 the footer is "This is applied for HCM", in page 4 the footer is "This is applied for HN", in page 5,6,7 the footer is "This is applied for HCM"

    Searched some solutions on Internet, but it comes out with same footer for all pages.

    Any help would be appreciated.

    Nguyen

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [VBA]Sub PrintFooters()
    Dim numPages As Long

    With ActiveSheet

    numPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")

    With .PageSetup
    .RightFooter = "This is applied for HCM"
    .PrintOut From:=1, To:=3
    .RightFooter = "This is applied for HN"
    .PrintOut From:=4, To:=4
    .RightFooter = "This is applied for HCM"
    .PrintOut From:=5, To:=numPages
    End With
    End With
    End Sub[/VBA]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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