View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.newusers
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default change background color based on range value

Sub findgroups()
'With Worksheets(1).Range("a1:z500")
Set c = Cells.Find(20, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
If c.Offset(, 1) = 30 And c.Offset(, 2) = 40 Then
c.Resize(, 3).Interior.ColorIndex = 33
End If
Set c = Cells.FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
'End With
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"DanL" wrote in message
...
I would like to search a spread sheet for a specific range value Ie

c1 c2 c3 c4 c5 c6
20 30 40
20 30 40

When 20 30 and 40 are found in neighboring columns I would like to turn
the
background of these 3 cells blue. How would I code this?

Thanks in advance - Dan