VBA & Macro Problems

Convert Manual Numbers to Custom Footnote Marks in Word with VBA

Jason MillerJason Miller Nov 18, 2026 869 views

Question details

Convert manually typed footnote numbers into Word footnotes that use those numbers as custom marks.

Convert Manual Numbers to Custom Footnote Marks in Word with VBA
Product
Microsoft Word
Device & OS
not provided
Scenario
A document converted from a PDF contains footnote numbers as ordinary text, and the user wants to create actual Word footnotes.
Observed behavior
The desired result is a Word footnote with the original number as its custom mark and the footnote content supplied separately.
Before you start

Identify each typed number and its corresponding footnote text. This example processes one selected marker at a time and requires a version of Word that supports VBA macros.

Solution 1Recommended

Create a Custom Footnote from a Selected Number with VBA

Use this macro when you can select a manual number and enter its corresponding footnote text.

Footnotes.Add uses the Reference argument for the custom mark and the Text argument for the footnote content. Capture the selected number before removing it.

This example does not find or remove existing footnote text automatically. Review any text left in the document after inserting the footnote.

1
Open the VBA editor

In Word, open Developer > Visual Basic. If the Developer tab is hidden, enable it in Word's ribbon settings.

2
Add the macro

In the VBA editor, choose Insert > Module and paste: Sub ConvertSelectedMarker() Dim markerRange As Range Dim marker As String Dim noteText As String Set markerRange = Selection.Range.Duplicate marker = markerRange.Text If Len(marker) = 0 Then MsgBox "Select a manual footnote number first." Exit Sub End If noteText = InputBox("Enter the footnote text:") If Len(noteText) = 0 Then Exit Sub markerRange.Text = "" markerRange.Collapse Direction:=wdCollapseStart ActiveDocument.Footnotes.Add Range:=markerRange, Reference:=marker, Text:=noteText End Sub

3
Select and convert a marker

Return to the document and select only the typed number in the main document body, without surrounding spaces. Open Developer > Macros, select ConvertSelectedMarker, and click Run.

4
Enter and check the footnote

Enter the corresponding footnote text in the prompt and click OK. Check the inserted mark and footnote, then repeat for the other manual numbers.

Create a Custom Footnote from a Selected Number with VBA
Custom marks are not automatic numbering: The original number becomes a custom mark, so Word will not automatically renumber it like an automatically numbered footnote. The InputBox is intended for short, plain-text entries.
Free Microsoft Office alternative

Work with Footnotes in WPS Writer

WPS Office is a free, lightweight Office alternative with a familiar interface and Microsoft Word format compatibility for an easier transition. WPS Writer supports document footnotes, although it does not fix or guarantee compatibility with Word-specific VBA macros.

Add and edit footnotes in WPS Writer documentsOpen and save documents in Microsoft Word formats, including DOCXUse a familiar interface to make the transition easierGet a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

What does the Reference argument do in Footnotes.Add?

Reference supplies the custom footnote mark. Use the separate Text argument for the content that appears in the footnote.

Why must I capture the manual number before deleting it?

Deleting the selected text removes the number from the document. Store Selection.Range.Text in a string first so you can pass it to Reference.

Does the macro move existing footnote text automatically?

No. Enter the corresponding text in the prompt, then review and remove any original text that should no longer remain in the document.

Will Word automatically renumber these custom marks?

No. A custom mark preserves the supplied number rather than using Word's automatic footnote numbering.