View Single Post
 
Old 01-29-2017, 07:26 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Change as follows:
Code:
Sub ListChange()
Dim r As Range
Dim MyList() As String
Dim i As Long
    MyList = Split("challenging,difficult,down by,", ",")
    For i = 0 To UBound(MyList())
        Set r = ActiveDocument.Range
        With r.Find
            Do While .Execute(FindText:=MyList(i))
                Select Case i
                    Case Is = 0
                        r.HighlightColorIndex = wdYellow
                    Case Is = 1
                        r.HighlightColorIndex = wdTurquoise
                    Case Else
                        r.HighlightColorIndex = wdGreen
                End Select
                r.Collapse 0
            Loop
        End With
    Next
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote