Conditional Formatting

  • Thread starter Thread starter DMP
  • Start date Start date
D

DMP

Hi,

Is it possible using the code below to have more than
three conditions in a column? If so,how do I modify to use
at least 5 conditions using s different colors??

Thanx

Range("K2:K41").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue,
Operator:=xlEqual, _
Formula1:="=""Bad Formula"""
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
End With
Selection.FormatConditions(1).Interior.ColorIndex = 38
End Sub
 
You can't have more than 3 conditional formats per cell,
your VBA is simply creating the same things as the worksheet
conditional formatting solution.
see Gord's answer in this thread.

--
 
Hi DMP,
I guess you weren't in the same thread I thought you were.
Many of the newsreaders and Google Groups Search get a bit messed
when you post with the same title as many others.

When you can't use Conditional Formatting because of the limit of 3 conditions
the normal progression is to use an Event Macro see
http://www.mvps.org/dmcritchie/excel/event.htm#case
As Gord Dibben pointed in that other thread, the spread sheet can look quite busy if you overdo the
colors (or even not be able to distinguish the the colors). Speaking of which take a look at
http://www.mvps.org/dmcritchie/excel/colors.htm
and look at comments concerning laptop, it can be hard to distinguish colors
even though you think you see pictures fine.
 
Back
Top