Formatting Issues

Fix WPS Office Excel Header Showing a Hash Instead of Page Number

Chanuka GeekiyanageChanuka Geekiyanage Nov 13, 2026 869 views

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.

Fix WPS Office Excel Header Showing a Hash Instead of 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.
Before you start

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.

Solution 1Recommended

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.

1
Select a worksheet cell

Click any empty cell in the worksheet that currently shows the hash in the header.

2
Enter printable content

Type a number or short text, such as Test, and press Enter.

3
Check Print Preview

Go to File > Print Preview, or click the Print Preview icon, and confirm the header now shows the page number.

4
Verify the printed page

Print the worksheet or export it as a PDF to confirm the page number appears correctly.

Enter Data So the Header Page Number Field Can Render
Page number displays correctly: Once printable content exists, the &P field is replaced by the actual page number in Print Preview and on the printed page.

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. 1. Open the workbook in WPS Office: Launch WPS Office Spreadsheets and open the worksheet that shows the hash in the header.
  2. 2. Add printable content: Click any blank cell, type a value such as 1 or Sample, and press Enter.
  3. 3. Open Header & Footer: Go to Insert > Header & Footer and select the header section containing &P.
  4. 4. Check Print Preview: Click File > Print Preview or use the Print Preview shortcut to verify the header now shows the page number.
  5. 5. Print or export: Print the page or export it as a PDF to confirm the page number appears correctly.
Correctly renders the &P page-number field in headers after printable content is presentFree and lightweight Excel-compatible Office suite with familiar header and footer toolsFull compatibility with .xlsx, .xls, and .xlsm workbook formatsPrint Preview and PDF export show the actual page number before printing
microsoft office alternative - wps office

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.