First off, I'm a relative newbie. I found this macro(?) below and would like to add it to a worksheet because it is supposed to make it possible for me to highlight different words. To customize it to my needs:
1. where in the string do I add the words that I want highlighted
2. does it matter if I want to only highlight in one column
3. once customized how do I make it work on my worksheet.
Option Explicit
Sub HighlightCells()
Dim Lookin As Range, ff As String
Dim i As Long
Dim Fnd As Variant
Dim fCell As Range
Dim ws As Worksheet
Dim xitem As Variant
' Fnd = Array("default", "Google")
Fnd = Array("Ad hoc", "Adaptable", "Adequate", "And/or", "Approximately", "As a minimum", "As applicable" _
, "As appropriate", "As possible")
For Each ws In Worksheets
With ws
For Each xitem In Fnd
Set Lookin = .Cells.Find(xitem, Lookin:=xlValues, LookAt:=xlPart)
If Not Lookin Is Nothing Then
ff = Lookin.Address
Do
Lookin.Characters(InStr(1, Lookin, xitem), Len(xitem)).Font.ColorIndex = 3
Set Lookin = .Cells.FindNext(Lookin)
Loop Until ff = Lookin.Address
End If
Set Lookin = Nothing
Next
End With
Next
End Sub
Many thanks!
Bookmarks