Conditional Formatting

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
 
D

David McRitchie

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.

--
 
D

David McRitchie

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top