How to Remove Spaces Before Footnote Numbers in Microsoft Word
Question details
The user needs to remove unwanted spaces immediately preceding superscript footnote references in a Word document, particularly when standard Find and Replace wildcard searches cannot locate them.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Cleaning up the formatting of a document downloaded from an external database before formal submission.
- Observed behavior
- A regular space appears before superscript footnote numbers, and built-in wildcard searches fail to isolate and remove these specific spaces.
Always create a backup copy of your document before running any VBA macros to prevent accidental data loss or irreversible formatting changes.
Use a VBA Macro to Target Footnote References
Since the standard Find and Replace tool struggles to isolate spaces specifically tied to footnote references, a VBA macro is the most effective way to target and delete them automatically.
This approach uses a macro that scans the document for text formatted with the 'Footnote Reference' style. It checks the character immediately preceding the footnote; if it is a regular space, the macro deletes it.
Open your document in Microsoft Word and press 'Alt + F11' on your keyboard to launch the Visual Basic for Applications (VBA) editor.
In the top menu of the VBA editor, click 'Insert' and select 'Module' to create a new blank code window.
Paste a VBA script designed to loop through all text with the 'Footnote Reference' style, check the preceding character for a regular space (ASCII 32), and delete it.
Close the VBA editor to return to your document. Press 'Alt + F8', select the macro you just created, and click 'Run' to remove the spaces.

Format Professional Documents Seamlessly with WPS Office
If you frequently encounter frustrating formatting restrictions or need a lighter, faster application for editing complex documents, WPS Office is an excellent choice. It provides a robust word processing environment that easily manages complex footnotes, citations, and professional formatting without the heavy resource footprint.
- 1. Download and Install: Visit the official WPS website to download and install WPS Office for free.
- 2. Open Your Document: Launch WPS Writer and open your .docx file containing the footnotes.
- 3. Edit Seamlessly: Use the familiar interface to adjust your footnote formatting or utilize the built-in Find and Replace tools.

Frequently Asked Questions
Why can't I find spaces before footnotes using normal Find and Replace?
In Microsoft Word, superscript footnote references are treated as special characters rather than standard text. Normal wildcard searches often fail to isolate the boundary between regular text spaces and these special reference marks.
Can I remove these spaces manually without a macro?
Yes, you can manually place your cursor before each footnote number and press the Backspace key. However, for long documents with hundreds of footnotes, a macro saves a significant amount of time and prevents human error.
Why do documents downloaded from databases have unwanted spaces?
Documents exported from external databases or web platforms often contain automated formatting artifacts. During the HTML-to-Word conversion process, extra spaces or non-breaking spaces are sometimes mistakenly inserted right before the footnote tags.




