If you have several worksheets in your Excel file, and you want to print your Excel worksheets, you must insert sequential page numbers across the worksheets. In this article, we will demonstrate to you 3 easy and effective methods to do the task smoothly.
Download Practice Workbook
You can download the Excel file and practice while you are reading this article.
3 Methods to Insert Sequential Page Numbers Across Worksheets
You can see the following Excel file has several Worksheets. We want to print the worksheets, so we need to insert sequential page numbers across the worksheets. To do the task, we will show to you 3 easy and effective methods. Here, we used Excel 365. You can use any available Excel version.
1. Using Page Layout Tab to Insert Page Number Across Worksheets
Here, we have three worksheets named Sheet 1, Sheet 2, and Sheet 3. Next, we want to print these worksheets. In this method, we will use the Page Layout tab to Insert Page Number Across Worksheets.
Let’s go through the following steps to do the task.
- First of all, from Sheet 1 of our Excel file >> go to the Page Layout tab.
- After that, from the Page Setup group >> select Page Setup drop-down arrow which is marked with a red color box.
At this point, a Page Setup dialog box will appear.
- Furthermore, go to the Header/Footer group.
Then, you can see Custom Header and Custom Footer options.
- Here, we selected Custom Header as we want the page number on top of the page.
Next, a Header dialog box will appear.
Here, you can see the Left section, Center section, and Right section.
- Afterward, we click on the Center section as we want the page number in the center of the page.
Moreover, we click on the Insert Page Number box which is marked with a red color.
As a result, you can see in the center section, &[Page] appears. This &[Page]Â indicates that the page number will be inserted in the center section of the page.
- After that, click OK.
Later, in the Page Setup dialog box, you can see 1 in the Header box, indicating the starting page number.
- Afterward, click OK.
- At this point, repeat the following steps to insert the page number in Sheet 2 and Sheet 3 as well.
- Then, select Sheet 1, press and hold the  SHIFT key, and select Sheet 2 and Sheet 3.
One thing that must be noted here is 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.
- Along with that, go to the File tab.
- After that, select the Print option.
Afterward, in the Print Preview pane, you can see page number 1 on top of Sheet 1.
- Next, click on the rightward arrow to see the page number of other worksheets.
Next, you can see page number 2 on top of Sheet 2.
- After that, click on the rightward arrow to see the page number of 3rd worksheet.
Finally, you can see page number 3 on top of Sheet 3.
Read More: How to Insert Page Number in Excel (7 Easy Methods)
Here, we have three worksheets named Sheet-1, Shee-2, and Sheet-3. Now, we want to print these worksheets. In this method, we will use the Header & Footer option to Insert Page Number Across Worksheets.
Let’s go through the following steps to do the task.
- First, we will click on Sheet-1, press and hold the  SHIFT key, and select Sheet-2 and Sheet-3.
Here, you must keep holding the SHIFT key until you go to the Print Preview pane to see the preview of the page number.
- After that, go to the Insert tab.
Here, 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.
- Afterward, from Text group >> select Header & Footer.
- Then, hover your mouse on top of your sheet. You will see three sections under the Header title.
- Furthermore, we click on the center section as we want our page number on the top and center positions of the sheet.
- Furthermore, click on the Header option from the Header & Footer group.
Then, you can see several page number styles appear.
- Here, we selected Page 1 of? as our page number style.
Afterward, you can see Page # of 1 in the center of the page.
- Next, keep holding the SHIFT key, and go to the File tab.
- After that, select the Print option.
Therefore, in the Print Preview pane, you can see page number as Page 1 of 3 on top of Sheet-1.
- Next, click on the rightward arrow to see the page number of other worksheets.
Furthermore, you can see page number as Page 2 of 3 on top of Sheet-2.
- Then, click on the rightward arrow to see the page number of the 3rd page.
Finally, you can 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
3. Applying VBA to Insert Sequential Page Number Across Worksheets
Here, we have three worksheets named VBA1, VBA2, and VBA3. Next, we want to print these worksheets. In this method, we will use VBA code to do the task. Applying VBA code is a handy and quick method to Insert Page Number Across Worksheets.
Let’s go through the following steps to do the task.
- In the beginning, go to the Developer tab >> select Visual Basic from the Code group.
At this point, a VBA editor window will appear.
- Moreover, from the Insert tab >> select Module.
- After that, we will type 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
- Here, we declare Page_Number_Across_worksheets as our Sub.
- We take the work_sheets variable as
- We use the For loop to run the code across the worksheets until it finds the sheet VBA3.
- Afterward, click on the Run button which is marked with a red color box to run the code.
- Then, we will close the VBA editor window and return to our worksheet.
- At this point, we will press and hold the SHIFT key and select the worksheets VBA1, VBA2, and VBA3.
Here, 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.
- In addition, go to the File tab.
- Later, select the Print option.
As a result, in the Print Preview pane, you can see page number 1 on top of sheet VBA1.
- After that, click on the rightward arrow to see the page number of other worksheets.
Moreover, you can see page number 2 on top of sheet VBA2.
- Next, click on the rightward arrow to see the page number of 3rd worksheet.
Finally, you can see page number 3 on top of sheet VBA3.
Read More: How to Insert Page Number Using VBA in Excel (3 Macros)
Inserting Sequential Page Number in Single Worksheet
We have the following Excel file with a single worksheet. Here, we want to print the worksheet. We will use the Header & Footer option to do the task.
Here, we will use the Header & Footer option to insert page number in a single worksheet.
Let’s go through the following steps to do the task.
- First of all, go to the Insert tab.
- Afterward, from Text group >> select Header & Footer option.
- Afterward, hover your mouse on top of your sheet. You will see three sections under the Header title.
- Furthermore, we click on the center section as we want our page number on the top and center positions of the sheet.
Moreover, we will go to the Header & Footer tab.
- Along with that, from the Header & Footer Elements group >> we will select Page Number.
Therefore, you can see in the center section, &[Page] appears. This &[Page]Â indicates that the page number will be inserted in the Center section of the page.
Then, we will go to the File tab.
- After that, we select the Print option.
Hence, in the Print Preview pane, you can see page number 1 on top of the page.
Read More: How to Show Page Number in Excel Background (2 Ways)
Things to Remember
- In Method 2, where we use the Header & Footer option, you must press and hold the SHIFT key to select adjacent worksheets. Also, you have to hold and press the SHIFT key throughout the whole method until you go to the Print Preview
- You can add more worksheets to your VBA code, and you must mention the sheet name properly in the VBA code.
Conclusion
Here, we tried to show you 3 methods to insert sequential page numbers across worksheets. Thank you for reading this article, we hope this was helpful. If you have any queries or suggestions, please let us know in the comment section below. Please visit our website Exceldemy to explore more.