How to Insert Page Number in Excel (7 Easy Methods)

In this tutorial, I will show you 7 easy methods to insert a page number in excel. Obviously, adding page numbers to the document will make it easier to navigate and share with others. This is especially true if the document has a large number of pages. We will see in this tutorial how excel provides various features to accomplish this.


Download Practice Workbook

You can download the practice workbook from here.


7 Easy Methods to Insert Page Number in Excel

1. Using Page Layout View Style to Insert Page Number

The Page Layout command in excel controls how the document will look after printing. We will use this command to insert the required page number in our worksheet.

Steps:

  • First, go to the View tab, and from the Workbook Views section, select Page Layout.

Using Page Layout View Style to Insert Page Number

  • Now, move the mouse pointer to the top of the page and you will see the box with the text Add Header.

Using Page Layout View Style to Insert Page Number

  • Then, click on the Add Header box and go to the tab Header & Footer.

Using Page Layout View Style to Insert Page Number

  • Next, click on the Page Number option and this will enter the code &[Page] in the box.
  • Here, press the Space key once and type “of” and again press the Space key.

Using Page Layout View Style to Insert Page Number

  • Now, click on the Number of Pages option and this will enter the code &[Pages].

  • Finally, click on anywhere else on the worksheet, and the page number will show up at the top of the page.


2. Utilizing Page Setup Dialogue Box

The Page Setup option in excel gives us the opportunity to make our workbook appear more organized. One of them is that we can insert a page number very easily. Let us see how we can do that.

Steps:

  • To begin with, navigate to the Page Layout tab and click on the arrow shown below.

Utilizing Page Setup Dialogue Box

  • Now, in the new Page Setup window, go to the Header/Footer tab, and from the Header drop-down select Page 1 of ?.
  • Next, press OK.

Utilizing Page Setup Dialogue Box

  • Finally, this will insert the page number in the header section.


3. Insert Page Number Starting from a Desired Number

If you want to insert a page number but manually set the number of the starting page, then you can use this method.

Steps:

  • First of all, go to the Page Layout tab and click on the arrow shown below.

Insert Page Number Starting from a Desired Number

  • Next, in the Page Setup window go to the Page tab and enter your desired page number in the field First page number.

Insert Page Number Starting from a Desired Number

  • After that, go to the Header/Footer tab and select Page 5 from the drop-down Header.
  • Then, press OK.

  • Finally, 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


4. Insert Page Number Using Insert Tab in Excel

We can insert page number in an excel worksheet using the Insert tab. This will allow us to first insert a Header and then set the page number there. Follow the steps below.

Steps:

  • To begin with, go to the Insert tab, and under the Text section select Header&Footer.

Insert Page Number Using Insert Tab in Excel

  • Now, take the mouse pointer to the top of the page and click on the middlebox.
  • Then, click on the Page Number option and this will insert the code &[Page] in the box.
  • Here, press Space and type of and Space again.

Insert Page Number Using Insert Tab in Excel

  • After that, click on the option Number of Pages.

  • Finally, the page number will appear on top of the page.


5. Add Page Number from Status Bar

One of the quickest methods to insert page number in excel is to use the status bar. Let us go through the steps.

Steps:

  • First of all, go to the Page Layout tab in the Status Bar at the bottom of your screen.

Add Page Number from Status Bar

  • Now, as previously click on the middle box on top of your screen and select Page Number.

Add Page Number from Status Bar

  • Then, type of and click Number of Pages.

  • As a result, excel will add the page number to the top of your screen.


6. Insert Page Number in Multiple Worksheets

When we have multiple excel worksheets and we want to insert a page number to each of them, then this method will save a lot of time instead of doing it manually.

Steps:

  • First, go to the Page Layout tab and click on the arrow in the lower-right corner.

Insert page Number in Multiple Worksheets

  • Next, in the Page Setup window go to the Header/Footer tab and click on Custom Header.

Insert page Number in Multiple Worksheets

  • Now, in the Header window, click on the Center section and select Insert Page Number.

  • Then, type of and select Insert Number of Pages.
  • Now, press OK.
  • As a result, excel will insert page numbers to all the open worksheets.

Read More: How to Insert Sequential Page Numbers Across Worksheets


7. Insert Page Number Inside a Cell Using VBA

This VBA method will allow us to insert page number in any section of our pages, unlike the previous methods where we could only insert them on the top or bottom.

Steps:

  • First, go to the Developer tab and select Visual Basic.

Insert Page Number Inside a Cell Using VBA

  • Now, in the Visual Basic window click Insert and then Module.

Insert Page Number Inside a Cell Using VBA

  • Next, type 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

Insert Page Number Inside a Cell Using VBA

  • Then, close the Visual Basic window and select any empty cell. There go to the tab View.
  • Here, from the Macros drop-down select View Macros.

Insert Page Number Inside a Cell Using VBA

  • Now, click on Run.

  • Consequently, the VBA code will add page numbers to the cell you selected.

Read More: How to Insert Page Number Using VBA in Excel (3 Macros)


How to Remove Page Number in Excel

If you do not want to have any page number in your document or you have only a single-page document, then you can use this method to remove the page number.

Steps:

  • First, go to the View tab and select Page Layout.
  • Then, take your mouse pointer to the box containing the page number.

How to Remove Page Number in Excel

  • Next, click on the page number and you will see a code like the image below.

How to Remove Page Number in Excel

  • Here, press the backspace key once.

  • Immediately, 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


Conclusion

I hope that you understood the methods I showed in this tutorial to insert page number in excel and were able to apply them properly. Among the various ways, the one you might want to use will depend on your situation, the size of the document, etc. Lastly, to learn more excel techniques, follow our ExcelDemy website. If you have any queries, please let me know in the comments.


Related Articles

Nazmul Hossain Shovon

Nazmul Hossain Shovon

Hello, I am Nazmul Hossain. I am currently working full-time in Exceldemy as an Excel & VBA Content Developer. I have completed my bachelors in Naval Architecture and Marine Engineering from Bangladesh University of Engineering and Technology. I am interested in working with MS Excel. I also like coding web applications a lot.

We will be happy to hear your thoughts

Leave a reply

ExcelDemy
Logo