PDA

View Full Version : [SOLVED] Conditionally Color Drop-down Choices



Sharpie123
05-28-2005, 07:31 AM
I am a new member and hope that this is the correct forum for this question. If not I apologize for the mistake. Here is what I am trying to do:

I have created a spreadsheet that contains a dropdown list with 6 choices. The selections for the dropdown are on sheet2 of the workbook. I have the dropdown functioning in multiple cells on sheet1. I want to add colors to the dropdown list so that when a particular entry is selected that entry is displayed in the cell and the cell fill color changes to reflect whichever color I assign to that entry. For Example: If the selections were Yes and No I would like to be able to set it so that if the selection was Yes then the word Yes would display in the cell and the cell fill color would change to Green. If the answer was No then the cell would display the word No and the fill color of the cell would change to Red

Hope someone can help with this and thank you

Norie
05-28-2005, 09:57 AM
What type of dropdowns are they?

With the simple Yes/No situation you could use Conditional Formatting. But if you have 6 choices another method would be needed.

And what that method would be would probably depend on what type of dropdowns you have created.

Bob Phillips
05-28-2005, 10:06 AM
And what that method would be would probably depend on what type of dropdowns you have created.

Also, if you have Excel97 it is relevant to Data Validation.

MWE
05-28-2005, 05:47 PM
With the simple Yes/No situation you could use Conditional Formatting. But if you have 6 choices another method would be needed.

DRJ submitted a KB on one way to have more than the 3 choice traditioinal Conditional Formatting provides: http://www.vbaexpress.com/kb/getarticle.php?kb_id=90

Sharpie123
05-29-2005, 06:25 AM
The drop-down list consists of 6 choices. NA, U, NI, Q, QP and KC. I want it so that the choices will be NA=White background, U=Red, NI=Yellow, Q=Green, QP=Brown and KC=Blue. I am using Excel2003. The link that MWE provided looks to be just what I am looking for. I will try it out. Thanks for the responses.

Sharpie123
05-29-2005, 08:36 AM
Thanks MWE. That piece of code works like a charm and I am able to do exactly what I wanted with it. Thank you very much and thanks also to the others that responded

Anne Troy
05-29-2005, 11:17 AM
Hi, Sharpie. I'm going to change the title of your post so it has some meaning to others, and I'll mark it solved for you as well (using Thread Tools menu at the top of the page).

Welcome to VBAX!