this is tested and all refer to the same sheet <g
Sub AAAA()
With Worksheets(1).UsedRange
Set c = .Find(0, LookIn:=xlValues, Lookat:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Interior.ColorIndex = 2 'white
c.Font.ColorIndex = 1 ' black
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
With Worksheets(1).UsedRange
Set c = .Find(0, LookIn:=xlValues, Lookat:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Interior.ColorIndex = 4 'green
c.Font.ColorIndex = 2 ' White
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
With Worksheets(1).UsedRange
Set c = .Find(2, LookIn:=xlValues, Lookat:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Interior.ColorIndex = 32 'darker is 25
c.Font.ColorIndex = 2 ' white
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
End Sub
--
Regards,
Tom Ogilvy
"Tom Ogilvy" wrote in message
...
I thought Don provided some assistance.
This does 0 to 2 you should be able to get the rest. Look in help for
the
colorindex property to get the colorindexes you need. This is bascially
the help example for the find method adapted to you values and
requirements:
With Worksheets(2).UsedRange
Set c = .Find(0, lookin:=xlValues, Lookat:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Interior.ColorIndex = 2 'white
c.Font.ColorIndex = 1 ' black
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
With Worksheets(2).UsedRange
Set c = .Find(0, lookin:=xlValues, Lookat:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Interior.ColorIndex = 4 'green
c.Font.ColorIndex = 2 ' White
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End Wit
With Worksheets(1).UsedRange
Set c = .Find(2, lookin:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Interior.ColorIndex = 32 'darker is 25
c.Font.ColorIndex = 2 ' white
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With
--
Regards,
Tom Ogilvy
"Kath" wrote in message
...
This must be the busiest forum I've been on. :D
Can no-one help me, or at least move me to the correct forum if I'm in
the wrong place :(
Or even point me in the right direction to get help with this ;)
------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/