#1
|
|||
|
|||
print pages with footer of last page different
Hi All,
I need to print all pages in a sheet with "continued on next page" at the foot of each page where there is a follow on page. Obviously the last page footer needs to be different saying something like "end of document" or "last page". But there is no way of doing this easily in Excel 2003. I have come across some code that I think allows just a footer on the last page to be printed (see below). Is there a way to adapt this to get all pages footers (except last) to be something like "continued...." and the last page footer "End of doc...."? Thanks. Roy Sub test() Dim TotPages As Long TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") With ActiveSheet.PageSetup .RightFooter = "" ActiveSheet.PrintOut From:=1, To:=TotPages - 1 .RightFooter = "Your footer info" ActiveSheet.PrintOut From:=TotPages, To:=TotPages End With End Sub |
#2
|
|||
|
|||
Hi,
my suggestion for solution is to instead use the built-in functions that are available when creating header/footer. There you find symbols which represent current page and also total pages. With the help of those, you can easily create a footer that looks like this on page 1: Page 1 (of 7) and that will look like this on the last page: Page 7 (of 7) That also gives you the advantage of page numbers on each page. Kind regards Bjorn |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Page does not show header & footer | Ron O'Brien | Word | 5 | 01-04-2012 07:34 AM |
Print 2 pages to a sheet in Landscape page orientation | Alexie | Excel | 1 | 09-18-2010 01:29 AM |
pages show in preview but not in print layout | skipper64 | Word | 0 | 05-18-2010 04:46 PM |
Footer "page X of Y (y=total pages in doc)" | Dan360 | Word | 1 | 12-18-2008 01:30 PM |
Help with Header & Footer on first page only in Template | bvlgari | Word | 1 | 12-01-2008 03:25 PM |