I'm trying to change the colour of a few words on my sheet to red. A quick search online finds this:
Public Sub ChgTxtColor()
Set myRange = Range("A1:A100") 'The Range that contains the substring you want to change color
substr = "delete" 'The text you want to change color
txtColor = 3 'The ColorIndex which repsents the color you want to change
For Each myString In myRange
lenstr = Len(myString)
lensubstr = Len(substr)
For i = 1 To lenstr
tempString = Mid(myString, i, lensubstr)
If tempString = substr Then
myString.Characters(Start:=i, Length:=lensubstr).Font.ColorIndex = txtColor
End If
Next i
Next myString
End Sub
However, this will only change the colour of one word. Is there a way of modifying this so I can change the colour of multiple words to red?
Bookmarks