Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA Printing Custom Footer on all but last page
I need to print a custom footer on all but the last printed page of a sheet.
The last page can be of varied number.I have a basic knowledge of VBA and the macro I have written is not working very wel. Can somebody provide me with a correct macro that will do the job so that I can compare were I have gone wrong. Thanks. -- james cassidy |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA Printing Custom Footer on all but last page
Revision of Ron de Bruin code from http://www.rondebruin.nl/print.htm#not
Sub Test() Dim TotPages As Long TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") With ActiveSheet.PageSetup .RightFooter = "Your Header info" ActiveSheet.PrintOut From:=1, To:=TotPages - 1 .RightFooter = "" ActiveSheet.PrintOut From:=TotPages, To:=TotPages End With End Sub Assuming TotPages = 7 ActiveSheet.PrintOut From:=1, To:=TotPages - 1 prints 1 to 6 with footer ActiveSheet.PrintOut From:=TotPages, To:=TotPages prints 7 to 7 no footer Gord Dibben MS Excel MVP On Thu, 1 Apr 2010 11:12:01 -0700, Caruna wrote: I need to print a custom footer on all but the last printed page of a sheet. The last page can be of varied number.I have a basic knowledge of VBA and the macro I have written is not working very wel. Can somebody provide me with a correct macro that will do the job so that I can compare were I have gone wrong. Thanks. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA Printing Custom Footer on all but last page
thank you works well I can see the erro of my ways
-- james cassidy "Caruna" wrote: I need to print a custom footer on all but the last printed page of a sheet. The last page can be of varied number.I have a basic knowledge of VBA and the macro I have written is not working very wel. Can somebody provide me with a correct macro that will do the job so that I can compare were I have gone wrong. Thanks. -- james cassidy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Format page number in excel footer to start at a specific page # | Excel Discussion (Misc queries) | |||
Is there a way to begin printing a footer on page two in Excel? | Excel Discussion (Misc queries) | |||
Custom Footer for each page | Excel Worksheet Functions | |||
How do i get page 1 of 1 in a custom Footer | New Users to Excel | |||
Printing/Page Numbering in Footer | Excel Discussion (Misc queries) |