Insert current and total page numbers into footer

This tutorial shows how to insert the current page number over total number of pages into a footer in a specific sheet using Excel and VBA

EXCEL METHOD 1. Insert current and total page numbers into footer

EXCEL

Insert tab > Text group > Header & Footer > Select footer area > Design tab > Header & Footer Elements group > Page Number > Insert separation sign > Number of Pages > Click anywhere on the sheet
1. Select the Insert tab. Select Insert tab
2. Select the Text group.
3. Click on Header & Footer.
Select the Text group and click on Header & Footer
4. Scroll to the bottom of the page and select the footer area in which you want to show the current page number over total number of pages.
Note: In this example we have selected the center footer area.
Select footer area
5. Select the Design tab.
6. Click on Page Number in the Header & Footer Elements group.
Select Design tab and click Page Number in Header & Footer Elements group
7. This will insert &[Page] in the selected footer area which will show the current page number.
8. Add the separation sign.
Note: In this example we have used "/" as the separation sign between the current page number and total number of pages.
Insert Page number in footer and add separation sign
9. Click on Number of Pages in the Header & Footer Elements group. Click on Number of Pages in Header & Footer Elements group
10. This will insert &[Pages] in the selected footer area, after the separation sign, which will show the total number of pages.
11. Click anywhere on the sheet.
Current and total page numbers in footer

VBA METHOD 1. Insert current and total page numbers into footer using VBA

VBA

Sub Insert_Current_Total_Page_Number_Footer()
'declare a variable

Dim ws As Worksheet

Set ws = Worksheets("Sheet1")
With ws.PageSetup

.CenterFooter = "&P/&N"

End With

End Sub

NOTES
Note 1: This VBA code will insert the current page number and the total number of pages, separate by a / sign, into the center footer area of "Sheet1".

RELATED TOPICS
Related Topic Description Related Topic and Description
How to insert a header
How to insert a footer in a specific sheet
How to insert page numbers into a header in a specific sheet
How to insert page numbers into a header in a specific sheet
How to insert the current page number over total number of pages into a header in a specific sheet