cell color

B

bluejay

In EXCEL, I want to change the cell color to reflect the text value. Like if
the cell contains "John", I want the cell color to be green, if "Bob", the
cell color to be Blue, if "Frank", purple, if "Joe", red, etc. I want to be
able to display about 18 different colors. Conditional Formatting has a
limitation of three if conditions. Thanks for your help.
 
G

Guest

bluejay said:
In EXCEL, I want to change the cell color to reflect the text value. Like if
the cell contains "John", I want the cell color to be green, if "Bob", the
cell color to be Blue, if "Frank", purple, if "Joe", red, etc. I want to be
able to display about 18 different colors. Conditional Formatting has a
limitation of three if conditions. Thanks for your help.
Have you tried "if"?
 
O

OZDOC1050

Sub colourme18x()
For Each cell In Range("a1:a555")
If cell.Value = "fred" Then cell.Interior.ColorIndex = 35
If cell.Value = "bob" Then cell.Interior.ColorIndex = 37
If cell.Value = "frank" Then cell.Interior.ColorIndex = 39
Next
End Sub

continue to suit and adjust range where needed, record a macro if you to, to
get colour codes
cheers
Pete
 
G

Guest

You can use cell conditional formatting

condition1: Cell Value is Equal To John
then select the Format Color

Add >> conditions to suit
 

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