Display page number in footer based upon pages in the current tab


G

Guest

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
 
Ad

Advertisements

J

JE McGimpsey

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top