If value > x diplay in green


Posted by Geoff CE on August 03, 2001 8:35 AM

Thanks for last suggestion Cory - worked fine

Does anyone know how to display a number in a cell
with a colour related to its value, eg red if <=25,
green if >25?

Thanks in advance

Posted by Aladin Akyurek on August 03, 2001 8:42 AM

Activate the cell of interest.
Activate the option Format|Conditional Formatting.
On the Conditional Formatting dialog, select Formula is and enter for

Condition 1

=A1<=25

Activate Format, select Red via Color on Fonts tab.

For Condition 2 (again Formula Is) enter:

=A1>25

Select Green.

Aladin


Posted by Jim on August 03, 2001 8:50 AM

Geoff,
Private Sub Worksheet_Change(ByVal Target As Range)
If [A1] =<25 Then
[A1].Font.ColorIndex = vbRed
End If
If [A1] >=26 Then
[A1].Font.ColorIndex = vbGreen
End If
End Sub
Jim



Posted by Mark W. on August 03, 2001 12:05 PM

Third option...

Just apply the following custom number format
using the Format | Cells... menu command:

[Red][<=25]General;[Green]General