View Single Post
 
Old 01-22-2020, 11:25 AM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Sub ReplaceAwithhighlightedtext()
Dim oRng As Range
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Text = "A^t"
    Do While .Execute
      oRng.HighlightColorIndex = wdRed
      oRng.Collapse wdCollapseEnd
      oRng.HighlightColorIndex = wdAuto
    Loop
  End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote