View Single Post
 
Old 05-20-2015, 05:33 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Your question was asked and answered yesterday in the VBA Express forum. When you cross-post please have the courtesy to indicate that fact in your post. Otherwise as evidenced here people waste their valuable time giving your assistance for free!!

Code:
Sub ScratchMacro() 
     'A basic Word macro coded by Greg Maxey
    Dim oRng As Word.Range 
    Set oRng = ActiveDocument.Range 
    With oRng.Find 
        .Text = "Ref." 
        While .Execute 
            Do While oRng.Characters.Last.Next Like "[0-9]" _ 
                And oRng.Characters.Last.Next.Font.Superscript 
                oRng.MoveEnd wdCharacter, 1 
            Loop 
            oRng.Select 'Do something with the found range.
            oRng.Collapse wdCollapseEnd 
        Wend 
    End With 
lbl_Exit: 
    Exit Sub 
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote