page numbering not using header/footer

robertsmyth100

Board Regular
Joined
Sep 25, 2006
Messages
94
hello,

All the page numbering solutions appear to involve using the page header/ footer. Unfortunately i need to stick to a document template where the document number is in a cell on a sheet. Each sheet is only 1 page. the cell needs to state e.g. 5 of 25. how do i get excel to count the total number of pages and the page number.

thanks
Rob
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Give this macro a try

Code:
Sub test()
startsheet = ActiveSheet.Name
Application.ScreenUpdating = False
For Each Sheet In Worksheets
    Sheet.Select
    Count = 1
    For Each Page In Worksheets
         If Page.Name = ActiveSheet.Name Then GoTo 1
         Count = Count + 1
    Next Page
1
    Range("a1").Value = "Page " & Count & " of " & Sheets.Count
Next Sheet
Sheets(startsheet).Select
Application.ScreenUpdating = True
End Sub
 
Upvote 0
page numbers

i love your solution, but i need the page number to be placed in the footer

i have a multi-tab document, and each tab is 1-6 pages

i'm trying to print the entire worksheet (all tabs) and i need the page number of the worksheet to print

any help

thanks

Mike
 
Upvote 0
Sorry, I don't have any knowledge in working with headers/footers. And especially not with printing them.
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,575
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top