How to Fix Continuous Page Numbering Across Sections in Word
Question details
The user needs to fix page numbers that incorrectly restart in subsequent document sections despite being configured to continue from the previous section.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Formatting a multi-section document where sequential page numbering is required throughout all sections.
- Observed behavior
- The document displays repeating page numbers (e.g., 1, 2, 2 instead of 1, 2, 3) across different sections, ignoring the standard continuous numbering configuration.
Ensure you have a backup of your document before running any VBA macros, and verify that your file is saved in a macro-enabled format if you intend to keep the script for future use.
Use a VBA Macro to Force Continuous Section Numbering
Running a VBA macro quickly forces all document sections to continue page numbering sequentially, overriding any hidden restart toggles that the standard UI fails to fix.
Sometimes Word's user interface fails to apply continuous numbering across all sections, especially in complex documents with multiple section breaks. A VBA macro bypasses the UI and directly modifies the RestartNumberingAtSection property for every section's footer at once.
When copying macro code from the internet, be careful with formatting. Extra line breaks or missing spaces before continuation characters (underscores) will cause syntax errors.
Press 'Alt + F11' on your keyboard while in Word to open the Microsoft Visual Basic for Applications (VBA) editor.
In the VBA editor, click 'Insert' from the top menu bar, and then select 'Module' to open a blank script window.
Copy your VBA macro code and paste it into the module window. The core command should loop through sections using a logic like 'Footer.PageNumbers.RestartNumberingAtSection = False'.
Review the pasted code to ensure there are no extra blank lines between lines of code. Check that each continuation character (an underscore at the end of a line) is preceded by a single space and immediately followed by the next line of code without extra spacing.
Press 'F5' or click the green 'Run' arrow in the toolbar to execute the script. Close the VBA editor and verify your document's page numbers.

Easily Manage Section Page Numbering in WPS Office
WPS Writer offers an intuitive interface for managing headers, footers, and page numbers across multiple document sections without the need for complex VBA macros. It provides a simple visual toggle to maintain continuous numbering.
- 1. Open Header and Footer Mode: Open your document in WPS Writer and double-click the footer area of your page to enter edit mode.
- 2. Access Page Number Format: Navigate to the 'Header and Footer' tab on the top ribbon, click on 'Page Number', and select 'Format Page Numbers'.
- 3. Set to Continuous: In the dialog box, look under the 'Page numbering' section, choose the 'Continue from previous section' radio button, and click 'OK'.
- 4. Apply to Document: If you have multiple sections, simply scroll to the next section and verify the setting is applied, or use the 'Link to Previous' button to unify your footers.

Frequently Asked Questions
Why does my page numbering restart at 1 in the middle of my Word document?
This usually happens because a new section break was inserted (often for changing margins or orientation). Word's default behavior for new sections is sometimes set to restart page numbering. You must explicitly set the new section to 'Continue from previous section'.
Can I fix continuous page numbering without using a VBA macro?
Yes, you can manually click into the header or footer of each section, go to Page Number Format, and select 'Continue from previous section'. However, a macro is recommended if your document contains dozens of sections to save time and prevent manual errors.
Why am I getting a syntax error when pasting the macro code into the VBA editor?
Errors typically occur due to extra line breaks or missing spaces before continuation characters (underscores) introduced during copying and pasting from web browsers. Ensure the code is formatted continuously without unintended blank lines.
Are section breaks necessary for my document?
Section breaks are required if you need to change page orientation (e.g., portrait to landscape), margins, or columns within the same document. If you do not need these layout changes, using standard page breaks can help you avoid complex page numbering issues entirely.




