Fix WPS Office Excel Header Showing a Hash Instead of Page Number
Question details
The page-number code &P may appear as a hash character in a WPS Office spreadsheet header when the worksheet is completely empty, and users need it to display the actual page number.

- Product
- WPS Office Spreadsheets
- Device & OS
- not provided
- Scenario
- The user inserted the &P page-number code into a worksheet header but sees a hash instead of the page number while the worksheet has no printable content.
- Observed behavior
- The header shows a hash instead of the page number until the worksheet contains printable content; after data is entered, the page number renders correctly in Print Preview or on the printed page.
Open the affected workbook and check whether the worksheet contains any printable cell content. If the worksheet is completely empty, enter sample data in at least one cell before verifying the page number in Print Preview or on the printed page.
Enter Data So the Header Page Number Field Can Render
Use this solution when the worksheet is completely empty and the header displays a hash instead of the &P page number.
A page-number field such as &P is designed to render after the worksheet contains printable content. Adding any value to a cell is usually enough for the header to show the actual page number.
Click any empty cell in the worksheet that currently shows the hash in the header.
Type a number or short text, such as Test, and press Enter.
Go to File > Print Preview, or click the Print Preview icon, and confirm the header now shows the page number.
Print the worksheet or export it as a PDF to confirm the page number appears correctly.

Check the Header Section and Page Setup If the Hash Remains
Use this follow-up solution when the page number still does not display after entering data.
Fix the Header Page Number Display in WPS Office Spreadsheets
Open your Excel file in WPS Office Spreadsheets, add printable content to the blank worksheet, and check the header page number in Print Preview. WPS Office renders the &P field correctly after data is entered and keeps your Excel files fully compatible.
- 1. Open the workbook in WPS Office: Launch WPS Office Spreadsheets and open the worksheet that shows the hash in the header.
- 2. Add printable content: Click any blank cell, type a value such as 1 or Sample, and press Enter.
- 3. Open Header & Footer: Go to Insert > Header & Footer and select the header section containing &P.
- 4. Check Print Preview: Click File > Print Preview or use the Print Preview shortcut to verify the header now shows the page number.
- 5. Print or export: Print the page or export it as a PDF to confirm the page number appears correctly.

Frequently Asked Questions
Why does my WPS spreadsheet header show a hash instead of a page number?
This usually happens when the worksheet is completely empty. Enter data in at least one cell, then check File > Print Preview or the printed page to see the page number render correctly.
Does the &P code work in WPS Office spreadsheet headers?
Yes. In WPS Office Spreadsheets, you can insert &P in the header using Insert > Header & Footer. It displays the current page number after the worksheet contains printable content.
How do I insert a page number in a WPS spreadsheet header?
Open the worksheet, go to Insert > Header & Footer, click the header area, and type &P or use the page number button. Then check Print Preview to confirm the page number appears.
What should I do if the page number still shows as a hash after entering data?
Verify the correct header or footer section is selected, open Page Layout > Page Setup to inspect the header, and test in a new workbook. If the issue remains, update or repair WPS Office.
Will the hash character appear on the printed page?
Typically no. Once the worksheet has printable content, the &P page number field should appear correctly in Print Preview and on the printed page or PDF export.




