Re: help for a highlighter
Welcome to the Forums.
So this will only check one cell, correct?
Usually the easiest way to determine how to access something programmatically, you record a macro
doing your task, stop it and check the generated code in the VBA IDE.
Now, since your needing to do some searching in the cell before you do anything, it would be easier to just
record a macro changing the cells backcolor. Then we can use that as astarting place.
Re: help for a highlighter
This should get you started. It highlights the word "World!" in cell C6.
VB Code:
Private Sub HighLightMe()
'C6 contains "Hello World!" and highlights "World!"
Dim iStart As Integer
ActiveSheet.Range("C6").Select
iStart = InStr(1, ActiveCell.Value, "World!")
If iStart > 0 Then
'Turn off coloring for any previous finds
Selection.Font.ColorIndex = xlAutomatic
'Turn on coloring for the found word (World!)
ActiveCell.Characters(Start:=iStart, Length:=iStart + Len("World!")).Font.ColorIndex = 3
End If
End Sub