Consulting

Results 1 to 3 of 3

Thread: Adding numbers to footnotes that lack them

  1. #1
    VBAX Regular
    Joined
    Mar 2020
    Posts
    79
    Location

    Adding numbers to footnotes that lack them

    Footnotes in Word.jpg

    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

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    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
    Last edited by macropod; 12-19-2020 at 01:43 PM.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    VBAX Regular
    Joined
    Mar 2020
    Posts
    79
    Location
    Thanks Paul, that fixed 5000+ notes in a few seconds.
    Another macro to add to my knowledge.

    Jon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •