Footer on last page

L

Line Jockey

I want a footer to appear only on the last page of a form.
How do I accomplish this? The form could have from 1 to 5 pages.
 
R

Ron de Bruin

Hi Line

You can do it with a macro

Try this to print the activesheet

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.RightHeader = ""
ActiveSheet.PrintOut From:=1, To:=TotPages - 1
.RightHeader = "Your Header info"
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End With
End Sub
 
Top