Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a list of car dealerships. What I'd like to do is change the color of the cell based on what type of dealership it is. So, for example, if I have the cells:

ABC Ford
DEF Chevrolet
GHI Honda
JKL Hyundai
MNO Ford
PQR Volvo
STU Honda
VWX Honda
YZZ Mitsubishi

I would like any cells that contain "Ford" to turn red, and cells that contain "Chevrolet" to turn blue, etc.

Is this possible?

share|improve this question

migrated from stackoverflow.com Jul 19 '12 at 6:35

This question came from our site for professional and enthusiast programmers.

1  
You can use Conditional Formatting for this. –  Tim Williams Jul 18 '12 at 21:47
    
@TimWilliams You should post this as an answer :) –  JimmyPena Jul 18 '12 at 22:13
2  
@Jimmy - not much of an answer! Actually I voted to migrate to SuperUser, since it deosn't seem to be a programming question... –  Tim Williams Jul 18 '12 at 22:49
2  
@TimWilliams Why would migrating mean you can't answer? I would only avoid answering questions that were in danger of being closed. –  JimmyPena Jul 18 '12 at 22:51

1 Answer 1

What version of excel are you using?

If you are using Excel 2007 or 2010 you can use conditional formatting to achieve this.

However, if you are using an older version of excel (200,2003) the conditional formatting only lets you make 3 rules to change colors on.

TO get around this you can use VBA to activate when the range on that worksheet changes that you're watching, check if it's a value you want ot change for. If it is change it to the appropriate color, if it isn't, reset any existing formatting.

You can Google "VBA Conditional formatting" for examples of this.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.