It is very easy for you to insert page number in Excel. We are going to do it together.
How to insert text?
Click on insert.
Click on text on the right side.
Adding a footer
Choose “Header and Footer”, after clicking on the arrow beneath the text in step two.
Click on Number of pages
Click on an empty cell in any of the columns.
The 0 was showing &[pages] prior to clicking on an empty cell.
Note: To ensure that the page numbers appear on every page of the printed worksheet, you may need to set up page breaks or adjust the print area. To do this, go to the “Page Layout” tab on the ribbon and use the “Page Setup” section to set up your print area and page breaks.
The View Ribbon menu
Alternative method is to start from View menu in the Ribbon.
The full path would be: View > Page Layout.
The next step is to scroll down. At the bottom of the page select Click to add footer option.
From the Design Ribbon menu pick Page Number and Number of Pages options this time.
In the footer you should see &[Page]&[Pages] now. My proposal is to format it. I prefer &[Page] out of &[Pages].
At this point you can add more information to the Footer such as:
- Current Date
- Current Time
- File Path
- File Name
- Sheet Name
After you are done go to the Ribbon again and switch the view by clicking View > Normal.
Using a Macro
To insert page numbers in Excel using a macro, follow these steps:
Insert a new module in the Visual Basic Editor (VBE) by pressing Alt+F11.
Paste the following code into the module:
Sub InsertPageNumbers() 'Insert page numbers in the footer ActiveSheet.PageSetup.Footer.PageNumbers.Add Footer:=True End Sub
Save the module and close the VBE.
To run the macro, press Alt+F8 to open the Macro dialog box.
Select the InsertPageNumbers macro and click Run.