PDA

View Full Version : [SOLVED:] Adding numbers to footnotes that lack them



JPG
12-19-2020, 10:13 AM
27596

I need a macro that can check to see if a footnote at the bottom of the page has been numbered and if not number it.
I know how I can do this manually and recorded a macro but when run it crashed(but that was just a concept test).
I don't know how the issue happened.

Any help appreciated

Jon

macropod
12-19-2020, 01:12 PM
For example:

Sub Demo()
Application.ScreenUpdating = False
Dim FtNt As Footnote, Rng As Range
For Each FtNt In ActiveDocument.Footnotes
With FtNt
Set Rng = .Range.Paragraphs(1).Range
If Rng.Characters.First <> .Reference Then
Rng.InsertBefore " "
Rng.Collapse wdCollapseStart
Rng.FormattedText = .Reference.FormattedText
End If
End With
Next
Application.ScreenUpdating = True
End Sub

JPG
12-19-2020, 01:30 PM
Thanks Paul, that fixed 5000+ notes in a few seconds.
Another macro to add to my knowledge.

Jon