Method 1 – Using Page Layout View Style to Insert Page Number
Steps:
- Go to the View tab and from the Workbook Views section, select Page Layout.
- Place the mouse pointer to the top of the page and you will see the box with the text Add Header.
- Click on the Add Header box and go to the tab Header & Footer.
- Click on the Page Number option and this will enter the code &[Page] in the box.
- Press the Space key once and enter “of” and again press Space.
- Click on the Number of Pages option and this will enter the code &[Pages].
- Click anywhere on the worksheet and the page number will show up at the top of the page.
Method 2 – Utilizing Page Setup Dialogue Box
Steps:
- Navigate to the Page Layout tab and click on the arrow shown below.
- In the new Page Setup window, go to the Header/Footer tab and from the Header drop-down select Page 1 of ?.
- Press OK.
- This will insert the page number in the header section.
Method 3 – Insert Page Number Starting from a Desired Number
Steps:
- Go to the Page Layout tab and click on the arrow shown below.
- In the Page Setup window, go to the Page tab and enter your desired page number in the field First page number.
- Go to the Header/Footer tab and select Page 5 from the drop-down Header.
- Press OK.
- Excel will insert the page number that you entered as the first page.
Read More: How to Start Page Numbers at Different Number in Excel
Method 4 – Insert Page Number Using Insert Tab in Excel
Steps:
- Go to the Insert tab and under the Text section select Header&Footer.
- Place the mouse pointer to the top of the page and click on the middle.
- Click on the Page Number option and this will insert the code &[Page] in the box.
- Press Space and enter ‘of’ and press Space
- Click on the option Number of Pages.
- The page number will appear on top of the page.
Method 5 – Add Page Number from Status Bar
Steps:
- Go to the Page Layout tab in the Status Bar at the bottom of your screen.
- Click on the middle box on top of your screen and select Page Number.
- Enter of and click Number of Pages.
- Excel will add the page number to the top of your screen.
Method 6 – Insert Page Number in Multiple Worksheets
Steps:
- Go to the Page Layout tab and click on the arrow in the lower-right corner.
- In the Page Setup window, go to the Header/Footer tab and click on Custom Header.
- In the Header window, click on the Center section and select Insert Page Number.
- Enter of and select Insert Number of Pages.
- Press OK.
- Excel will insert page numbers into all the open worksheets.
Read More: How to Insert Sequential Page Numbers Across Worksheets
Method 7 – Insert Page Number Inside a Cell Using VBA
Steps:
- Go to the Developer tab and select Visual Basic.
- In the Visual Basic window, click Insert and select Module.
- Enter the following code in the window with the name Module1:
Sub Page_Count()
Dim xVCount As Integer
Dim xHCount As Integer
Dim xVBreak As VPageBreak
Dim xHBreak As HPageBreak
Dim xNumPage As Integer
xHCount = 1
xVCount = 1
If ActiveSheet.PageSetup.Order = xlDownThenOver Then
xHCount = ActiveSheet.HPageBreaks.Count + 1
Else
xVCount = ActiveSheet.VPageBreaks.Count + 1
End If
xNumPage = 1
For Each xVBreak In ActiveSheet.VPageBreaks
If xVBreak.Location.Column > ActiveCell.Column Then Exit For
xNumPage = xNumPage + xHCount
Next
For Each xHBreak In ActiveSheet.HPageBreaks
If xHBreak.Location.Row > ActiveCell.Row Then Exit For
xNumPage = xNumPage + xVCount
Next
ActiveCell = "Page " & xNumPage & " of " & Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
End Sub
- Close the Visual Basic window and select any empty cell. Go to the tab View.
- From the Macros drop-down select View Macros.
- Click on Run.
- The VBA code will add page numbers to the cell you selected.
Read More: How to Insert Page Number Using VBA in Excel
How to Remove Page Number in Excel
Steps:
- Go to the View tab and select Page Layout.
- Place the mouse pointer to the box containing the page number.
- Click on the page number and you will see a code as shown in the image below.
- Press the backspace key once.
- The page number will disappear and the title Add header will show up confirming this.
Read More: How to Remove Page Number from Page Break Preview in Excel
Download Practice Workbook
Related Articles
- How to Insert Page Number in Excel Cell Not in Header
- How to Use Formula for Page Number in Excel
- How to Print Page Number in Excel
<< Go Back to Page Number | Page Setup | Print in Excel | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!