How can I modify the code below to format all characters from the found word "over" right through to the last character in the cell. Neither the number of characters before or after the found word are constant, so using something like Start:=11, Length:=27 would not work.
Thanks for your help.
Sub Format_Characters_In_Found_Cell()
x = "over"
Set Found = Cells.Find(what:=x, LookIn:=xlValues, LookAt:=xlPart)
If Found Is Nothing Then
MsgBox x & " could not be found.", , " "
Else
'Format last character in found cell
' Found.Characters(Start:=Len(Found), Length:=Len(ActiveCell)).Font.ColorIndex = 5
'Format all characters in found cell
' Found.Characters(Start:=Len(ActiveCell), Length:=Len(Found)).Font.ColorIndex = 5
'Format 11th character in found cell through to last character in found cell
' Found.Characters(Start:=11, Length:=Len(ActiveCell)).Font.ColorIndex = 5
End If
End Sub
Thanks for your help.
Sub Format_Characters_In_Found_Cell()
x = "over"
Set Found = Cells.Find(what:=x, LookIn:=xlValues, LookAt:=xlPart)
If Found Is Nothing Then
MsgBox x & " could not be found.", , " "
Else
'Format last character in found cell
' Found.Characters(Start:=Len(Found), Length:=Len(ActiveCell)).Font.ColorIndex = 5
'Format all characters in found cell
' Found.Characters(Start:=Len(ActiveCell), Length:=Len(Found)).Font.ColorIndex = 5
'Format 11th character in found cell through to last character in found cell
' Found.Characters(Start:=11, Length:=Len(ActiveCell)).Font.ColorIndex = 5
End If
End Sub