Conditional Formatting. Can i get more then 3?

  • Thread starter Thread starter Matthew
  • Start date Start date
M

Matthew

Is there any way to get more then 3 conditional formats
for a group of cells? I would like to highlight different
names in a list of work assignments so i know quickly who
has what. I need more then 3 colors though. Is there a
way to do this?

thanks
 
Matthew, here is one way with a worksheet change macro

Private Sub Worksheet_Change(ByVal Target As Range)
For Each c In Worksheets("Sheet1").Range("A2:A12")
If c.Value = "a" Then c.Interior.ColorIndex = 1
If c.Value = "b" Then c.Interior.ColorIndex = 13
If c.Value = "c" Then c.Interior.ColorIndex = 3
If c.Value = "d" Then c.Interior.ColorIndex = 4
If c.Value = "e" Then c.Interior.ColorIndex = 5
If c.Value = "f" Then c.Interior.ColorIndex = 6
If c.Value = "g" Then c.Interior.ColorIndex = 7
If c.Value = "h" Then c.Interior.ColorIndex = 8
If c.Value = "i" Then c.Interior.ColorIndex = 9
If c.Value = "j" Then c.Interior.ColorIndex = 10
If c.Value = "k" Then c.Interior.ColorIndex = 11
If c.Value = "l" Then c.Interior.ColorIndex = 12
Next c
End Sub
To put in this macro right click on the worksheet tab and view code, in the
window that opens paste this code, press Alt and Q to close this window and
go back to your workbook. If you are using excel 2000 or newer you may have
to change the macro security settings to get the macro to run.
--
Paul B
Always backup your data before trying something new
Using Excel 97 & 2000
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
 
Back
Top