This code snippet should be placed in the worksheet's code page.
Its a simple demonstration of setting multicolor conditions
Option Explicit
' example code for conditional formatting
' sets a row to a color based off
' cell value in column A
Enum colors
Red = 255
Green = 65280
Blue = 16711680
Yellow = 65535
Amber = 52479
Purple = 16711935
White = xlNone
End Enum
Sub setcolors(Target As Range, color As Long)
With Target
.Interior.color = color
End With
End Sub
Sub CheckA()
CheckConditions Range("A:A")
End Sub
Sub CheckConditions(Target As Range)
Dim cell As Range
Dim color As Long
For Each cell In Target
Select Case cell.Value
Case Is < -10
color = colors.Red
Case Is < 0
color = colors.Amber
Case Is = 0
color = colors.Yellow
Case Is 100
color = colors.Green
Case Is 50
color = colors.Blue
Case Else
color = colors.White
End Select
setcolors Range(Cells(cell.Row, 1), Cells(cell.Row, "F")), color
Next
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
CheckConditions Target
End If
End Sub
Patrick Molloy
Microsoft Excel MVP
http://www.xl-expert.com/Files/Excel_Conditions.xls
"Jim Brass" wrote in message
...
Hi
My son is tracking the weather. He keeps track of all the temps. He
would like to conditionally format them in increments of 10 degrees(eg.
70's- blue; 80's - purple; etc.).
How can he do it for more than 3 conditions? Thanks Jim