5 Conditions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have set up 4 conditions in Excel based on the following

If a certain cell is
0, <95, Re
/=95, <100, Orang
=/>100 and =/<110, Gree

0 - there is no condition - whit

I would like to add another - condition which is

Does anyone know how to do this?
 
If you're referring to background colors, rather than fonts, you'll have
to use an event macro. One way:

Put this in the worksheet code module (right-click on the worksheet tab
and choose View Code):

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
With Range("A1")
If IsNumeric(.Value) Then
Select Case .Value
Case Is > 110
.Interior.ColorIndex = 5 'blue
Case Is >= 100
.Interior.ColorIndex = 10 'green
Case Is >= 95
.Interior.ColorIndex = 46 'orange
Case Else
.Interior.ColorIndex = 2 'white
End Select
Else
.Interior.ColorIndex = xlColorIndexNone
End If
End With
End If
End Sub
 
Back
Top