Our sample Excel file has several Worksheets. We will insert sequential page numbers across the worksheets.
Method 1 – Using Page Layout Tab to Insert Page Number Across Worksheets
We have three worksheets named Sheet 1, Sheet 2 and Sheet 3. We will use the Page Layout tab to Insert Page Number Across Worksheets.
- From Sheet 1 of our Excel file >> go to the Page Layout tab.
- From the Page Setup group >> select the Page Setup drop-down arrow (as shown in the image below).
A Page Setup dialog box will pop up.
- Go to the Header/Footer group.
- Select Custom Header to insert the page number on top of the page.
A Header dialog box will pop up.
- Click on the Center section to center align the page number in the center of the page.
Click on the Insert Page Number box (as shown in the image below).
As a result, you will notice in the center section, &[Page]. This &[Page] indicates that the page number will be inserted in the center section of the page.
- Click OK.
In the Page Setup dialog box, you will see 1 in the Header box, indicating the starting page number.
- Click OK.
- Repeat the following steps to insert the page number in Sheet 2 and Sheet 3.
- Select Sheet 1, press and hold the SHIFT key and select Sheet 2 and Sheet 3.
Note: One thing that must be noted here is that you must press and hold the SHIFT key to select adjacent sheets from the sheet tab. However, if you want to select multiple nonadjacent sheets from the sheet tab, press and hold the CTRL key.
- Go to the File tab.
- Select the Print option.
In the Print Preview pane, you will see page number 1 on top of Sheet 1.
- Click on the right arrow to see the page number of other worksheets.
You will see page number 2 on top of Sheet 2.
- Click on the right arrow to see the page number of 3rd worksheet.
You will see page number 3 on top of Sheet 3.
Read More: How to Insert Page Number in Excel
Method 2 – Use of Header/Footer Option
We will use the Header & Footer option to Insert Page Number Across Worksheets.
- Click on Sheet-1, press and hold the SHIFT key and select Sheet-2 and Sheet-3.
You must keep holding the SHIFT key until you go to the Print Preview pane to see the preview of the page number.
- Go to the Insert tab.
- From Text group >> select Header & Footer.
- Hover your mouse on top of your sheet. You will see three sections under the Header title.
- Click on the center section as we want our page number on the top and center aligned.
- Click on the Header option from the Header & Footer group.
You will see several page number styles.
- We have selected Page 1 of? as our page number style.
You will see Page # of 1 in the center of the page.
- Keep holding the SHIFT key and go to the File tab.
- Select the Print option.
In the Print Preview pane, you can see the page number as Page 1 of 3 on top of Sheet-1.
- You can click on the right arrow to see the page number of other worksheets.
You will see page number as Page 2 of 3 on top of Sheet-2.
- Click on the right arrow to see the page number of the 3rd page.
You will see page number Page 3 of 3 on top of Sheet-3.
Read More: How to Insert Page Number in Excel Cell Not in Header
Method 3 – Applying VBA to Insert Sequential Page Number Across Worksheets
The sample workbook has three worksheets named VBA1, VBA2, and VBA3.
- Go to the Developer tab >> select Visual Basic from the Code group.
- In the VBA editor window, from the Insert tab >> select Module.
- Enter the following code in the Module.
Sub Page_Number_Across_worksheets()
Dim work_sheets As Worksheet
Set all = Sheets(Array("VBA1", "VBA2", "VBA3"))
For Each work_sheets In all
work_sheets.Select
work_sheets.PageSetup.CenterHeader = "&p"
Next work_sheets
End Sub
Code Breakdown
- We have declared Page_Number_Across_worksheets as our Sub.
- We have taken the work_sheets as variable.
- We have used the For loop to run the code across the worksheets until it finds the sheet VBA3.
- Click on the Run button.
- Close the VBA editor window and return to the worksheet.
- Press and hold the SHIFT key and select the worksheets VBA1, VBA2 and VBA3.
- Go to the File tab.
- Select the Print option.
In the Print Preview pane, you can see page number 1 on top of sheet VBA1.
- You can click on the right arrow to check the page number of other worksheets.
You will see page number 2 on top of sheet VBA2.
- Click on the right arrow to see the page number of 3rd worksheet.
You will see page number 3 on top of sheet VBA3.
Read More: How to Insert Page Number Using VBA in Excel
Inserting Sequential Page Number in Single Worksheet
Using Header & Footer Option
- Go to Insert.
- From Text group >> select Header & Footer.
- Hover your mouse on top of your sheet. You will see three sections under the Header
- Click on the center section to insert the page number on the top with center alignment.
- Go to the Header & Footer tab.
- From the Header & Footer Elements group >> Select Page Number.
&[Page] will appear in the center section. This indicates that the page number will be inserted in the Center section of the page.
- Go to the File tab.
- Select the Print option.
In the Print Preview pane, you can see page number 1 on top of the page.
Read More: How to Print Page Number in Excel
Download Practice Workbook
Related Articles
- How to Remove Page Number from Page Break Preview in Excel
- How to Start Page Numbers at Different Number in Excel
- How to Use Formula for Page Number in Excel
<< Go Back to Page Number | Page Setup | Print in Excel | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!