logo
search
Printing Problems

How to Insert Page Numbers in Excel Cells and Repeat Top Rows

Maira MehtabMaira Mehtab Sep 20, 2026 870 views

Question details

The user wants to place printed page numbers directly inside spreadsheet cells rather than headers or footers, and needs to configure specific rows to repeat at the top of each printed page.

Product
Excel
Device & OS
not provided
Scenario
Formatting a spreadsheet for printing with custom pagination in specific cells and a repeating header row for multi-page documents.
Observed behavior
Excel's default print settings place page numbers in headers or footers and require specific Page Setup configurations for repeating rows, which the user is struggling to set up correctly.
Before you start

Before configuring your print layout, switch your workbook view to 'Page Layout' to accurately preview where your page breaks will occur.

Solution 1

Manually Insert Page Numbers into Worksheet Cells

Since Excel does not natively support inserting automatic page numbers directly into standard cells, you must identify page breaks and enter the numbers manually.

Excel's print settings are designed to handle page numbers via the Header and Footer sections. If your formatting strictly requires page numbers inside the grid cells, manual entry based on your row count is the most straightforward workaround without using VBA macros.

1
Switch to Page Layout View

Go to the 'View' tab on the Excel ribbon and click 'Page Layout'. This view shows you exactly how many rows fit on a single printed page.

2
Identify Page Breaks

Scroll down to find the bottom of your first printed page (for example, row 30 or row 45, depending on your margins and row heights).

3
Enter the First Page Number

Select the cell where you want the page number to appear at the bottom of the first page and type '1'.

4
Repeat for Subsequent Pages

Scroll down to the bottom of the next printed page (e.g., row 60), select the corresponding cell, and type '2'. Continue this pattern for the rest of your document.

Simplify Spreadsheet Formatting

Easily Manage Complex Print Layouts with WPS Office

WPS Office Spreadsheet provides an intuitive Page Layout interface that makes setting print titles, defining print areas, and customizing headers or footers effortless. It handles your printing needs smoothly without overwhelming dialog boxes.

  1. 1. Open Your Spreadsheet: Launch WPS Office and open your Excel workbook.
  2. 2. Navigate to Page Layout: Click on the 'Page Layout' tab located in the top menu ribbon.
  3. 3. Set Print Titles: Click 'Print Titles', select your desired header rows in the 'Rows to repeat at top' field, and click OK.
  4. 4. Customize Headers/Footers: To insert automated page numbers, go to the 'Insert' tab, select 'Header and Footer', and choose your preferred page number placement.
Easily set rows to repeat at the top of printed pages with a user-friendly interfaceFully compatible with Microsoft Excel (.xlsx) formatting and page setupsPreview print layouts instantly with precise scaling controlsFree to download and lightweight on system resources
microsoft office alternative - wps office

Frequently Asked Questions

Can I use an Excel formula to insert page numbers into cells automatically?

No, Excel does not have a built-in function to return the printed page number of a specific cell dynamically. You must either type the numbers manually or use a complex VBA macro to calculate page breaks.

Why is the 'Print Titles' button grayed out in Excel?

The 'Print Titles' feature becomes disabled if you are currently editing a cell (cursor flashing inside a cell), if multiple worksheets are grouped together, or if your computer does not have a default printer installed.

Will rows set to repeat at the top duplicate in my normal worksheet view?

No. Rows set using 'Print Titles' will only appear duplicated on the printed physical pages and within the Print Preview screen. They will not duplicate or disrupt your data in the standard Normal viewing mode.

How do I insert standard automated page numbers in Excel?

To add standard page numbers that update automatically, go to the 'Insert' tab, click 'Header & Footer', click inside the header or footer region, and select 'Page Number' from the Header & Footer Elements ribbon tab.