Thread: [Solved] Macro to highlight words
View Single Post
 
Old 06-27-2013, 07:33 AM
big0 big0 is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Jun 2013
Posts: 10
big0 is on a distinguished road
Default

Here is some code that I use to help me:

Sub ListChange()
Dim r As Range
Dim MyList() As String
Dim i As Long
MyList = Split("dot,com,like", ",")
For i = 0 To UBound(MyList())
Set r = ActiveDocument.Range
With r.Find
.Text = MyList(i)
.Replacement.Highlight = wdYellow
.Execute Replace:=wdReplaceAll
End With
Next
End Sub
Reply With Quote