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

Method 1 – Using Page Layout View Style to Insert Page Number

Steps:

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

Using Page Layout View Style to Insert Page Number

  • Place 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

  • Click on the Add Header box and go to the tab Header & Footer.

Using Page Layout View Style to Insert Page Number

  • Click on the Page Number option and this will enter the code &[Page] in the box.
  • Press the Space key once and enter “of” and again press Space.

Using Page Layout View Style to Insert Page Number

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

  • Click anywhere on the worksheet and the page number will show up at the top of the page.


Method 2 – Utilizing Page Setup Dialogue Box

Steps:

  • Navigate to the Page Layout tab and click on the arrow shown below.

Utilizing Page Setup Dialogue Box

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

Utilizing Page Setup Dialogue Box

  • This will insert the page number in the header section.


Method 3 – Insert Page Number Starting from a Desired Number

Steps:

  • Go to the Page Layout tab and click on the arrow shown below.

Insert Page Number Starting from a Desired Number

  • 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

  • Go to the Header/Footer tab and select Page 5 from the drop-down Header.
  • Press OK.

  • 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


Method 4 – Insert Page Number Using Insert Tab in Excel

Steps:

  • Go to the Insert tab and under the Text section select Header&Footer.

Insert Page Number Using Insert Tab in Excel

  • Place the mouse pointer to the top of the page and click on the middle.
  • Click on the Page Number option and this will insert the code &[Page] in the box.
  • Press Space and enter ‘of’ and press Space

Insert Page Number Using Insert Tab in Excel

  • Click on the option Number of Pages.

  • The page number will appear on top of the page.


Method 5 – Add Page Number from Status Bar

Steps:

  • Go to the Page Layout tab in the Status Bar at the bottom of your screen.

Add Page Number from Status Bar

  • Click on the middle box on top of your screen and select Page Number.

Add Page Number from Status Bar

  • Enter of and click Number of Pages.

  • Excel will add the page number to the top of your screen.


Method 6 – Insert Page Number in Multiple Worksheets

Steps:

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

Insert page Number in Multiple Worksheets

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

Insert page Number in Multiple Worksheets

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

  • Enter of and select Insert Number of Pages.
  • Press OK.
  • Excel will insert page numbers into all the open worksheets.

Read More: How to Insert Sequential Page Numbers Across Worksheets


Method 7 – Insert Page Number Inside a Cell Using VBA

Steps:

  • Go to the Developer tab and select Visual Basic.

Insert Page Number Inside a Cell Using VBA

  • In the Visual Basic window, click Insert and select Module.

Insert Page Number Inside a Cell Using VBA

  • Enter 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

  • Close the Visual Basic window and select any empty cell. Go to the tab View.
  • From the Macros drop-down select View Macros.

Insert Page Number Inside a Cell Using VBA

  • Click on Run.

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

Read More: How to Insert Page Number Using VBA in Excel 


How to Remove Page Number in Excel

Steps:

  • Go to the View tab and select Page Layout.
  • Place the mouse pointer to the box containing the page number.

How to Remove Page Number in Excel

  • Click on the page number and you will see a code as shown in the image below.

How to Remove Page Number in Excel

  • Press the backspace key once.

  • 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


Download Practice Workbook


Related Articles


<< Go Back to Page Number  | Page Setup | Print in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Nazmul Hossain Shovon
Nazmul Hossain Shovon

Nazmul Hossain Shovon, a BUET graduate in Naval Architecture and Marine Engineering, embarked on his career with 8 months dedicated to the Exceldemy project's triumph. Transitioning into a Software Developer role, he specialized in web add-in development. At Exceldemy, he authored about 125 blog articles and solved many visitors’ problems, refining his writing skills and delving into Excel-related topics. With a primary passion for programming and software development, Shovon continually explores new horizons, fostering professional growth in his... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo