PDA

View Full Version : Different footer for each page of a sheet



gaului
11-01-2012, 09:47 PM
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

Bob Phillips
11-02-2012, 02:48 AM
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