Conditional Formatting

L

Lisa

Is there any way to have more than three conditional
formats placed on any one cell? I want to use about 12,
but EXCEL is limited to three.
 
D

Dave Peterson

Not with conditional formatting.

but you could use a worksheet event that could do the same type thing.

If you post back, be sure to explain how the cell will change--calculation or
typing.
 
L

Lisa

I want to change the cell's colour. I'm doing up a
schedule, and I want to be able to colour the different
type of shifts that we're scheduling, so that a quick
glance shows whos who.
 
D

Dave Peterson

Right click on the worksheet tab that should have this behavior and select view
code. Paste this in:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub

With Target
Select Case LCase(.Value)
Case Is = "abc": .Interior.ColorIndex = 5
Case Is = "def": .Interior.ColorIndex = 6
Case Is = "ghi": .Interior.ColorIndex = 7
Case Is = "jkl": .Interior.ColorIndex = 8
Case Is = "mno": .Interior.ColorIndex = 9
Case Is = "pqr": .Interior.ColorIndex = 10
Case Else
.Interior.ColorIndex = xlNone
End Select
End With

End Sub

Back to excel and type something in column A. (abc, def, ..., pqr will do
something with the color).

Chip Pearson has some nice notes about workbook/worksheet events at:
http://www.cpearson.com/excel/events.htm

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 

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