How to Add & Remove Page Number in Excel?

Get FREE Advanced Excel Exercises with Solutions!

In this Excel tutorial, you will learn how to add page number in Excel. You will also learn to add sequential page numbers, page numbers on even or odd pages, and customized first-page number. Besides, you will also learn how to remove the added page number in Excel.
We have used Microsoft 365 for the examples and applications. However, they are also applicable to other versions too.

Page number in Excel is the process of adding sequential numbers to the pages of printed documents. For a large amount of data, page number helps to organize the workbook. It allows the user to navigate through pages and define references easily. At the time of cross-referencing, it is a big help for the user. It also produces a touch of professionalism in your workbook.

Here I have added the page number with the total number of pages at the header.

Page Number in Excel

Click here to see the full image


Download Practice Workbook


How to Add Page Number on Single Worksheet

We will add the page number on a single worksheet with the available options in the Header & Footer tab.

  • Click on the worksheet name to select a specific single worksheet.

Selecting Single Worksheet

  • Go to the Insert tab and select Header & Footer from the ribbon.

Command to Insert Header and Footer

  • Select Header —> Header & Footer Tab —> Header Option  —> Pick a Format.
Command Sequence to Add Page Number

Click here to see the full image

  • Click anywhere on the sheet and we will have the page number at the center of the header.

 Adding Page Number on Single Worksheet

Alternate Way:

  • Select Header —> Header & Footer Tab —> Header & Footer Elements group —> Page Number.
Command Sequence to Add Page Number

Click here to see the full image

  • We will have &[Page] at the defined place.
Adding Page Number in Header

Click here to see the full image

  • Just click outside the header, and we will have the page number on the worksheet.

Adding Page Number on Single Worksheet


How to Add Page Number on Multiple Worksheets

We will discuss adding page numbers in the middle of the header in multiple worksheets.

  • Keep the Ctrl key pressed and click on the worksheet tabs to select them.

  • Open the Page Setup dialog box and click on Custom Header… from Header/Footer.

Selecting Custom Header Option

  • Write the page number format in Center section.

Defining Custom Header Format

  • Click OK again.

Click OK Again for Confirmation

We have page numbers in the middle of the header in multiple worksheets.

Alternate Ways of Multiple Sheet Selection:

  • To select adjacent multiple worksheets, click on the first sheet name and click on the last sheet name till you want to select holding the Shift key.

Selecting Multiple Worksheets

  • To select all the worksheets, right-click on the mouse putting the cursor on sheet name and select Select All Sheets.

Selecting Multiple Worksheets

Note
To add page numbers in multiple worksheets, you can apply any of the methods of adding page number after selecting multiple worksheets.

How to Add Sequential Page Numbers in Excel

This section is to demonstrate the normal numbering procedure of multiple pages.

  • Select Header —> Header & Footer Tab —> Header Option —> Page 1 of ? format.
Order Sequence for Inserting Sequential Page Numbers on Multiple Worksheets

Click here to see the full image

  • Page numbers will be inserted sequentially.
Inserting Sequential Page Numbers on Multiple Worksheets

Click here to see the full image

How to Enable Header & Footer Tab

To enable the Header & Footer tab, go to the Insert tab and select Header & Footer from the ribbon.

Inserting Header & Footer tab

Alternatively, go to the View tab —> Workbook Views group —> Page Layout.

Enabling Header & Footer from View Tab


How to Have Customized First Page Number

This section describes the procedure to have a customized first-page number. For more clarification, we will add the date and time on the first page only.

  • Go to Header & Footer —> check the Different First Page box.
  • Insert a page number format with the tools of Header & Footer Elements according to your preferences.
Command Sequence of having Different First Page Number

Click here to see the full image

  • The unique style of page number for the first page will be set and it won’t be applied to the rest of the other pages.
Having Different First Page Number

Click here to see the full image


How to Add Page Numbers on Odd or Even Pages

This portion is to describe the procedure to add page numbers on odd pages.

  • Go to the Header & Footer tab —> Options group —> check the Different Odd & Even Pages option
  • Select the Header of an odd page.
  • Insert the page number format.
Commands to Insert only Odd Page Numbers

Click here to see the full image

  • We can see that the page number is added only on the odd pages and the even pages will not have any page number.
Inserting Only Odd Page Numbers

Click here to see the full image


How to Use Random Number to Start Page Numbering

We will pick a random number and use it to start page numbering.

  • Go to the Page Layout tab —> click on the extension key of the Page Setup group.

Extended Key of Page Setup

  • Go to the Page tab —> set the number as the First page number field —> click OK.

Defining Page Number of First Page

  • Finally, the defined page number will be set as the first page number.

Random Page Number of First Page


How to Define Page Numbering Order (Down, Then Over or Over, Then Down)

There are two types of the page numbering order. One is to number the page row-wise first and then move to column-wise (over, then down). Another one is to number the page column-wise first and then move to row-wise (down, then over).

  • To set the page numbering order, click on the extension key of the Page Setup group from the Page Layout tab.

Extended Key of Page Setup

  • Go to the Sheet tab —> select Over, then down from Page Order —> click OK.

Command Sequence of Numbering Page in Different Order

  • The page number will be set over the columns first and then downwards.
Numbering Page in Different Order

Click here to see the full image

  • You can select a page numbering order Down, then over from Page Order.

Selecting Down then Over Option

Then, you will have page numbers downwards first and then over the columns.

Output of Down then Over Option

Click here to see the full image


How to Modify Page Number Format

We will modify the added page number format here.

  • To change the font of the page number, select page number command —> Home tab —> Font group —> Font.
Changing Page Number Font

Click here to see the full image

  • We can change the font size by selecting page number command —> Home tab —> Font group —> Size.
Changing Page Number Font Size

Click here to see the full image

  • We have further modified the page number format with the Bold and Font Color options from the Font group.
Modifying Page Number Format

Click here to see the full image

We have clicked outside of the page number box and found a modified page number according to our commands.

Final Modified Page Number Format

Click here to see the full image


How to Insert Page Number in Selected Cell

We will use VBA to insert a page number in a selected cell of a worksheet.

  • Select a cell —> Developer tab —> Visual Basic.

Opening Visual basic Editor

  • .From Visual Basic EditorInsert —> Module.

Creating a Module

  • Write the following VBA code.
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

Code for Inserting Page Number in a Cell

We will have the page number in the selected cell.

Inserting Page Number in a Cell

Read More: How to Insert Page Number in Excel


How to Remove Page Number

If your Excel file comes with page numbers already there and you don’t want that, you can remove them using the following options.


1. Using Header & Footer Option to Remove Page Number

To remove the page numbers, select the page numbering commands from the header or footer and remove them from there.

Using Header & Footer to Remove Page Number

Click here to see the full image


2. Using Page Setup Dialog Box to Remove Page Number

We will use the Page Setup dialog box to remove the page numbers.

  • Open the Page Setup dialogue box.
  • Go to Custom Header or Custom Footer based on your page number location.

Command Sequence to Remove Page Number from Header

  • Remove the page numbering command —> click OK —> click OK again.
Removing Page Number from Header

Click here to see the full image

Read More: How to Remove Page Number from Page Break Preview in Excel


Which Things Should You Remember?

  • Usually, page numbers are added as either a header or footer.
  • Page numbers can’t be seen in Normal mode.
  • In the time of numbering even page numbers only, you need to be on one of the even pages.

Conclusion

This concludes our discussion on the page number in Excel. It includes multiple ways of adding page numbers in the header and footer through the Header & Footer tab and the Page Setup dialogue box. Hopefully, you have also learned to add page numbers in the sequential or custom order as we described in these procedures.

We also included two different methods to remove page numbers in Excel. They also follow the same route of adding them.

I hope this article will be helpful for you. For any further questions, please comment below. You can also visit our site for more Excel-related articles. Thank you.


Frequently Asked Questions

1. Is it possible to customize the number of rows and columns on a page?

We can easily customize the number of rows and columns on a page. For this, go to the Page Break Preview mode from the View tab and move the page border lines to customize the page.

2. Is it possible to reset the number of rows and columns on a page?

We can reset the customized number of rows and columns on a page. For this, open the Page Setup dialogue box and input 1 in the Fit to and Wide by boxes, and click on OK.

3. Is there a formula for page numbers in Excel?

No, there is no built-in formula for page numbers in Excel, but there is code to do so as we have discussed in the above sections of the article.


Page Number in Excel: Knowledge Hub


<< Go Back to Page SetupPrint in Excel | Learn Excel

 

What is ExcelDemy?

ExcelDemy - Learn Excel & Get Excel Solutions Center provides online Excel training , Excel consultancy services , free Excel tutorials, free support , and free Excel Templates for Excel professionals and businesses. Feel free to contact us with your Excel problems.
Naimul Hasan Arif
Naimul Hasan Arif

Naimul Hasan Arif, a BUET graduate in Naval Architecture and Marine Engineering, has been contributing to the ExcelDemy project for nearly 2 years. Currently serving as an Excel and VBA Content Developer, Arif has authored over 120 articles. His expertise lies in Microsoft Office Suite, and he thrives on learning new aspects of data analysis. Arif's dedication to the ExcelDemy project is reflected in his consistent contributions and ongoing enthusiasm for expanding his knowledge in data analysis.

Designation

Excel &... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo