CONDITIONAL FORMAT
This can be accomplished by using the worksheet change event. The following
macro monitors changes in A1:A10 and set the background color:
Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Range("A1:A10"), Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target.Select
i = Selection.Value
With Selection.Interior
.ColorIndex = i
.Pattern = xlSolid
End With
Application.EnableEvents = True
End Sub
The sample macro only works with integers and assigns colors based upon the
integers. You could modify it to operate in a more general way.
__________________Have a good day!
Gary's Student
"qwerty" wrote:
is there any way to have more than 3 conditional formats or something like
doing it by formula?
thanks in advance
|