This is fairly simple to achieve by using an array to hold the terms to find in quotes separated by commas e.g.
Sub HighLightList() Dim vFindText As Variant Dim oRng As Range Dim i As Long vFindText = Array("lorem", "ipsum") 'the words or phrases to find For i = 0 To UBound(vFindText) Set oRng = ActiveDocument.Range With oRng.Find .ClearFormatting .Replacement.ClearFormatting Do While .Execute(findText:=vFindText(i), _ MatchWholeWord:=True, _ Forward:=True, _ Wrap:=wdFindStop) = True oRng.HighlightColorIndex = wdYellow oRng.Collapse wdCollapseEnd Loop End With DoEvents Next lbl_Exit: Set oRng = Nothing Exit Sub End Sub




Reply With Quote
