Sub Mydemo()Dim c As Range, n, m, l AsIntegerDimstr'initial set
Range("A1:AZ9999").Select
Selection.Font.Color= RGB(0,0,0)str= Application.InputBox("Input:","My InputBox")
l =Len(str)Set c = Cells.Find(What:=str, Lookat:=xlPart)
c.Activate
c.Characters(m, l).Font.Color= RGB(0,0,0)'the first areaFor m =1ToLen(c.Value)'When find the specified str,set the color red.IfMid(c.Value, m, l)=strThen
c.Characters(m, l).Font.Color= RGB(255,0,0)EndIfNext'the second area to the last areaFor n =1To c.CurrentRegion.Count
Set c = Cells.FindNext(after:=ActiveCell)
c.Activate
For m =1ToLen(c.Value)IfMid(c.Value, m, l)=strThen
c.Characters(m, l).Font.Color= RGB(255,0,0)EndIfNextNextEndSub