#1   Report Post  
baileygrrrl
 
Posts: n/a
Default "If" statement?

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.
  #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.
.

  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

How about conditional formatting. You could have a condition like

=A1=$A$1

where the word is in A1, and apply to a whole range.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"baileygrrrl" wrote in 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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If statement and Isblank statement Rodney C. Excel Worksheet Functions 0 January 18th 05 08:39 PM
IF Statement with Average Function results in #Value! Paul Excel Discussion (Misc queries) 5 December 28th 04 08:11 AM
7+ nested if statement? Turi Excel Worksheet Functions 3 December 20th 04 07:55 PM
Statement lintan Excel Worksheet Functions 1 December 2nd 04 11:31 PM
IF Statement difficulty susan hayes Excel Worksheet Functions 3 November 2nd 04 09:46 PM


All times are GMT +1. The time now is 01:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"