Removing Spaces before Footnote References

Written by Allen Wyatt (last updated August 14, 2021)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


3

Christine has a document that has over 2,000 footnotes and there is a space between the last letter of the word and the footnote reference. She wonders if there is a way to delete the space before the footnote reference without having to do it manually.

The easiest way to do this is through a two-pass Find and Replace operation:

  1. Press Ctrl+H. Word displays the Replace tab of the Find and Replace dialog box.
  2. In the Find What box, enter a space followed by ^f. (The ^f indicates you want to find a footnote mark.)
  3. In the Replace With box, enter %^&. (The % character should be some character or sequence of characters that are not used anywhere in your document. The ^& indicates that you want to include what was matched by the Find What text.)
  4. Click Replace All.
  5. Change what is in the Find What box to % followed by a space. (The % character should be whatever unique character you used in step 3.)
  6. Clear the Replace With box; it should contain nothing.
  7. Click Replace All.

The only time that this two-pass process wouldn't work is if the footnote mark just before the actual footnote (not in the main text) was preceded by a space and you wanted that space to remain. Searching for ^f finds footnote marks in the main text and in the footnote area. If you want the retain the space in the footnote area and only remove the space in the main text, then you shouldn't use Replace All in step 4. Instead, click Find Next and replace only those instances in the main text.

You may wonder why I mentioned the two-pass Find and Replace technique as "the easiest way" when, in fact, you could use a single wildcard Find and Replace approach. Before explaining, here are the steps to use wildcards:

  1. Press Ctrl+H. Word displays the Replace tab of the Find and Replace dialog box.
  2. Click the More button, if it is available.
  3. Make sure the Use Wildcards check box is selected.
  4. In the Find What box, enter a space followed by (^2). (Not the use of the parentheses; these are important.)
  5. In the Replace With box, enter \1. (This indicates you want to replace using the first item within parentheses in the Find What box—in this case, the footnote mark.)
  6. Click Replace All.

Note the use of the ^2 marker in step 4. If you use ^f (as was done in the previous set of steps), you'll get an error because this is not a valid wildcard code—it only works with a regular Find and Replace. If, with the insertion point in the Find What box, you click the Special button, you won't see an option for the footnote mark. In fact, none of the options available using the Special button will result in adding the ^2 marker. This seems to be an undocumented marker that has lived on among Word power users since the earliest days of the program.

Here, though, is the reason why I indicated the two-pass Find and Replace approach was easier—the ^2 marker doesn't match just footnote marks. It also matches endnote marks, which means that if your document contains both footnotes and endnotes—as some longer, more complex documents may—you could end up replacing more than you really want to replace.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (912) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Preventing the Left Margin of a Footer from Moving

When you print a document, does the position of the page footer seem to move left and right? This could have to do with ...

Discover More

Extracting Street Numbers from an Address

Want to know how to move pieces of information contained in one cell into individual cells? This option exists if using ...

Discover More

Getting Rid of Modify Style Message

When you apply styles to a paragraph, you may periodically see a message asking if you want to reapply the style or ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (ribbon)

Changing Space between the Footnote Separator and Footnotes

When you add footnotes to a document, Word separates those footnotes from the document body with a separator line. Here's ...

Discover More

Inserting Footnotes Using Custom Footnote Marks

Automatic footnotes are easy to insert in Word documents. The default settings are usually fine for most projects. ...

Discover More

Turning Off Printing of Document Properties

Getting to a printed document is often the entire purpose of using Word. The program, however, allows you to print out ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is five more than 8?

2023-11-11 05:29:50

Mohammad

Thank you very much for your great tips. It worked for me.


2021-08-15 05:20:26

Ken Endacott

Here is a macro that does the same thing but does not cause scrolling of the document.

Sub RemoveSpaceBeforeFootnote()
Dim aRange As Range
Dim aFootnote As Footnote
For Each aFootnote In ActiveDocument.Footnotes
Set aRange = aFootnote.Reference
aRange.Collapse
aRange.MoveStart unit:=wdCharacter, Count:=-1
If aRange.Text = " " Then aRange.Text = ""
Next aFootnote
End Sub


2021-08-15 01:39:43

Tomek

I suggest a macro approach rather than a two-pass find-and-replace. The macro would find the footnote, then check whether the preceding character is a space, and if so, delete it; if not it would go to the next footnote. The macro would run a for-next loop as many times as there are footnotes. Here is the code:


Public Sub RemoveSpacesBeforeFootnotes()


Selection.HomeKey Unit:=wdStory
cnt = ActiveDocument.Footnotes.Count


For I = 1 To cnt
Selection.GoToNext wdGoToFootnote
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
If Selection.Text = " " Then
Selection.Delete
Else
Selection.Collapse wdCollapseEnd
'collapse if not space otherwise it will loop
'around the same footnote reference
End If

Next I


End Sub


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.