Thread: "If" statement?
View Single Post
  #2   Report Post  
 
Posts: n/a
Default

hi,
Private Sub ComboBox2_Change()
Dim c As String
Dim rng As Range
Dim cell As Range
Dim sAddr As String
c = Inputbox ("Enter something to find")
Range("A1:iv65000").Interior.ColorIndex = xlNone
If c = "" Then Exit Sub
Set rng = Range("A1:IV65000").Find(What:=c, _
After:=Range("A1"), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng Is Nothing Then
sAddr = rng.Address
Do Until rng.Address = sAddr
rng.Interior.ColorIndex = 42
Set rng = Range("A1:IV65000").FindNext(rng)
Loop End If
End Sub

-----Original Message-----
Is there a way to have excel to highlight each instance

of a particular word
in a file?

Eg. I need excel to look for the word "delivered" in a

worksheet and
highlight it each time it finds that word - by highlight

I mean change the
text colour or cell shading or some other way to make it

stand out.
.