Hi - From thread68-223068
Acron posted this (which I have altered slightly to be a little more suitable)
Private Sub Worksheet_Calculate()
Dim oCell As Range
For Each oCell In Range("A1:A20"

Select Case oCell.text
Case "Outage"
oCell.Interior.ColorIndex = 3
Case "No Protection","No Redundancy"
oCell.Interior.ColorIndex = 44
Case "Other"
oCell.Interior.ColorIndex = 33
Case else
oCell.Interior.ColorIndex = xlnone
End Select
Next oCell
End Sub
That code must be placed in the codemodule od teh actual sheet you are working with. To that select the sheet in question, right click on the sheet tab and select View Code. You can then place code above in the resultantt code pane. You will need to change the range references (I have used A1:A20 in the example), to suit the range you are working with. You can also change the values applied to the color index to suit your own requirements.
For a non VBA solution, Euskadi proposed the following - alter to suit your needs
I'd like to throw out a non-VBA alternative for those who come across this issue and who only have 5 criteria to deal with...
If you use three conditional formats (for 1, 2, and 3), you can add in a custom number format for the other 2 conditions:
[Red][=4]General;[Blue][=5]General;General
I know this doesn't solve your issue with 7 conditions, but for folks who have just 4 or 5 conditions, this will get them some formating without using VBA
HTH
~Geoff~
![[noevil] [noevil] [noevil]](/data/assets/smilies/noevil.gif)