Thread: Color
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Color

If those two colors are your only choices, color B1 blue then select it and
FormatConditional FormattingCondition1Formula is:

=IF(A1100,A1<200)

Format to red and OK.


Gord Dibben MS Excel MVP

On Sun, 15 Jul 2007 08:26:01 -0700, AlanW
wrote:

Mike,
Other than the programming you mentioned, can I just simply use IF THEN ELSE
function in the worksheet to do it.

Thank you

"Mike" ???

Sub colorChange()
If Range("A1").Value 100 Then
If Range("A1").Value < 200 Then
Range("B1").Interior.ColorIndex = 3
Else
Range("B1").Interior.ColorIndex = 11
End If
End If
End Sub

"AlanW" wrote:

Could someone please show me the way to have a cell color changed based on
the condition of another cell. For example, if A1 100 and < 200 then B1's
color is red else blue. Thank you.