conditional formating

  • Thread starter Thread starter amit
  • Start date Start date
A

amit

Hello,

Please help me for conditional formatting. I am using the
conditional formating for coloring the cells depends upon
the condition given in conditional formatting. My problem
is how can i add more than 3 conditions there, as in Excel
98-in format menu-conditional formatting provides only 3
conditions at a time. What is the solution on this
problem. Please help me.

Thanks in advance
Amit
 
Hi
conditional format only accepts 3 conditions though you have a fourth
if you include the default format.

If you only want to apply different FONT colors based on NUMBERS, you
can define up to 6 different styles. See:
http://www.mcgimpsey.com/excel/conditional6.html
for instructions how to do it

For everything else you'll need VBA code (e.g. process the
worksheet_change event and apply your format based on the cell values).
The following will color the entry in cell A1:A100 based on its value:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("A1:A100")) Is Nothing Then Exit Sub
On Error GoTo CleanUp:
With Target
Select Case .Value
Case 1: .Font.ColorIndex = 3
Case 2: .Font.ColorIndex = 10
'etc.
End Select
End With
CleanUp:
Application.EnableEvents = True
End Sub
 
Back
Top