ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Display page number in footer based upon pages in the current tab (https://www.excelbanter.com/excel-discussion-misc-queries/159431-display-page-number-footer-based-upon-pages-current-tab.html)

Ben Fochs

Display page number in footer based upon pages in the current tab
 
I have a very large file which has over thirty tabs with multiple pages for
each tab and I deperately need to modify the footer to display the page
numbers in the following manner. . .

Tab 1 - Page 1.1, 1.2, 1.3, 1.4, etc.
Tab 2 - Page 2.1, 2.2, 2.3, 2.4, etc.
Tab 3 - Page 3.1, 3.2, 3.3, 3.4, etc.
.. . . etc.

However, as listed below, I am only able to use the TOTAL page numbers for
the second digit. . .

Tab 1 - Page 1.1, 1.2, 1.3, 1.4
Tab 2 - Page 2.5, 2.6, 2.7, 2.8
Tab 3 - Page 3.9, 3.10, 3.11, 3.12
.. . . etc.

This is requiring me to print every page individually which is probably
adding about two to three hours of manual work on a monthly basis, so any
help would be GREATLY appreciated.

Thanks!
Ben

JE McGimpsey

Display page number in footer based upon pages in the current tab
 
One way, using a macro:

To print all sheets in the workbook:

Public Sub PrintAllPages()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws.PageSetup
.CenterFooter = "Page " & ws.Index & "." & "&p"
End With
ws.PrintOut
Next ws
End Sub

or, to print only those sheets that you've selected:

Public Sub PrintSelectedSheetPages()
Dim ws As Worksheet
For Each ws In ActiveWindow.SelectedSheets
With ws.PageSetup
.CenterFooter = "Page " & ws.Index & "." & "&p"
End With
ws.PrintOut
Next ws
End Sub



In article ,
Ben Fochs <Ben wrote:

I have a very large file which has over thirty tabs with multiple pages for
each tab and I deperately need to modify the footer to display the page
numbers in the following manner. . .

Tab 1 - Page 1.1, 1.2, 1.3, 1.4, etc.
Tab 2 - Page 2.1, 2.2, 2.3, 2.4, etc.
Tab 3 - Page 3.1, 3.2, 3.3, 3.4, etc.
. . . etc.

However, as listed below, I am only able to use the TOTAL page numbers for
the second digit. . .

Tab 1 - Page 1.1, 1.2, 1.3, 1.4
Tab 2 - Page 2.5, 2.6, 2.7, 2.8
Tab 3 - Page 3.9, 3.10, 3.11, 3.12
. . . etc.

This is requiring me to print every page individually which is probably
adding about two to three hours of manual work on a monthly basis, so any
help would be GREATLY appreciated.

Thanks!
Ben



All times are GMT +1. The time now is 12:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com