If I understand, this may help get you started. It will color all
cells containing "p1" yellow. This could be expanded to different
colors for different text. Brad
Sub ColorMe()
For Each c In ActiveSheet.UsedRange
If Contains("p1", c) Then
With c.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Else
With c.Interior
.ColorIndex = xlNone
.Pattern = xlNone
End With
End If
Next
End Sub
Function Contains(LookFor, LookIn)
On Error GoTo ErrorHandler
temp = Application.WorksheetFunction.Search(LookFor, LookIn)
'if no error
Contains = True
Exit Function
ErrorHandler:
Contains = False
End Function