Cell Entry Color
Posted by hbendillo on January 07, 2002 11:12 AM
I would like to write a macro or function that compares entries in two cells and colors one of the entries red based on the result. Here is something that I came up with that does not quite work. Perhaps it will give you a better idea of what I am trying to do:
Sub Test BusSize()
BusSize=Sheet("Audit").Range("E9").Value
DemandAmps=Sheet("Audit").Range("H9").Value
If DemandAmps > BusSize Then BusSize.Interior.ColorIndex=3
Else BusSize.Interior.ColorIndex=xlnone\
EndIf
It is the entry in cell "E9" that I want to change to red, not the background color of the cell. I have to do a number of times in a chart and so will repeat the if statement for each occurence. Thanks.