View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
patrick molloy patrick molloy is offline
external usenet poster
 
Posts: 391
Default Conditional Formatting

The follwoing code looks in a sheets range
called 'MyRange' ...

Sub ColorTest()

Dim Trgt As Range
Dim firstadd As String
Set Trgt = ThisWorkbook.Names
("MyRange").RefersToRange.Find("business")


If Not Trgt Is Nothing Then
firstadd = Trgt.Address
Do
Trgt.Interior.ColorIndex = 34
Set Trgt = ThisWorkbook.Names
("MyRange").RefersToRange.FindNext(Trgt)
Loop Until Trgt.Address = firstadd
End If


End Sub

Patrick Molloy
Microsoft Excel MVP


-----Original Message-----
I am using Excel 97 and want to colour a cell if it
includes the word say for example 'business' somewhere

in
the text of that cell.

Checking each cell in a column of lets say a 1000 entries

Can anyone assist me with some code if this is possible
please?


Thanks

Mark
.