+ Reply to Thread
Results 1 to 6 of 6

Color Key Drop Down Box

  1. #1
    Valued Forum Contributor
    Join Date
    07-16-2007
    Location
    GA
    MS-Off Ver
    Office 365 - Version 2403
    Posts
    1,059

    Question Color Key Drop Down Box

    Hi,

    I have a legend with color codes in it & no text (yet) in the cells.

    I can make a drop down option or list that will "see" these colors?


    Using Excel 2013


    Thanks
    MyCon
    -- Using Latest Version of Excel

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Color Key Drop Down Box

    Not clear what you mean by a dropdown list that can "see" colors. Can you give a more complete description of the overall problem you are trying to solve, what you want the user to see and be able to do? Are you talking about cell fill color, or text color?

    The only thing I can imagine is that you want the dropdown box to be a list of the color codes shown in the legend, and also have the items in the dropdown be the same color as what is in the legend. Data Validation dropdown lists and combobox controls do not support colored background or colored text for list items. There might be some other exotic way to get there, though, if we can understand your problem better.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Valued Forum Contributor
    Join Date
    07-16-2007
    Location
    GA
    MS-Off Ver
    Office 365 - Version 2403
    Posts
    1,059

    Re: Color Key Drop Down Box

    Hi 6StringJazzer & Others,

    Yes - I thought I could use a Data Validation List Drop down option but appears that Excel does not have this option to "see" colors.

    For example - My legend has:

    A1 - Red cell with no text
    A2 - Yellow cell with no text
    A3 - Blue cell with no text

    Can Excel utilize a Data Validation (drop down) list to search these cells & "see" the color schemes, then user can select need cell or color?

    Thanks

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Color Key Drop Down Box

    No, you can't do this with data validation. Here is one way that uses VBA and a form. This is a simple example to demonstrate the technique. It assumes three cells in your legend. If you change the fill colors of the cells in the legend, the colors on the form will be updated automatically. If you double click on any cell, the form comes up and you can press the button for the desired color.
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    07-16-2007
    Location
    GA
    MS-Off Ver
    Office 365 - Version 2403
    Posts
    1,059

    Re: Color Key Drop Down Box

    Hi 6StringJazzer

    The userform is cool. How does it work?

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Color Key Drop Down Box

    Well, it's kind of a long explanation. In Excel, hit ALT-F11. That will open the VBA development window. You will see something like that looks like this.

    Under Forms, you will see a user form. Double click on it, and you will the form itself. Right click and select View code, and you will see the code that drives the controls. The idea is that when the form is activated, it looks up the color of each cell in the legend and then sets the button color to match. Then if you push a button, it sets the color of the currently selected cell to match that color. There isn't a lot of code needed to do this.

    If you know nothing at all about VBA then it's a bit difficult to give a complete course in all of this in a forum post. Let me know where you want to go from here and I'll see if I can help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 02-04-2013, 02:00 PM
  2. Color in cells with drop down box
    By dnunley in forum Excel General
    Replies: 6
    Last Post: 10-28-2009, 10:15 AM
  3. Drop Down Box Color Fill
    By Mary Frances in forum Excel General
    Replies: 8
    Last Post: 03-17-2009, 09:49 AM
  4. How to very color in drop down list
    By cat123 in forum Excel General
    Replies: 2
    Last Post: 05-15-2007, 10:18 AM
  5. Drop down list (color)
    By jimz97 in forum Excel General
    Replies: 1
    Last Post: 03-14-2007, 11:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1