How to Insert Page Numbers in Excel Cells and Repeat Top Rows
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 configuring your print layout, switch your workbook view to 'Page Layout' to accurately preview where your page breaks will occur.
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.
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.
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).
Select the cell where you want the page number to appear at the bottom of the first page and type '1'.
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.
Configure Rows to Repeat at the Top
Use the Print Titles feature within Page Setup to select a header row that will automatically print at the top of every page.
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. Open Your Spreadsheet: Launch WPS Office and open your Excel workbook.
- 2. Navigate to Page Layout: Click on the 'Page Layout' tab located in the top menu ribbon.
- 3. Set Print Titles: Click 'Print Titles', select your desired header rows in the 'Rows to repeat at top' field, and click OK.
- 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.

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.




