+ Reply to Thread
Results 1 to 5 of 5

Create a picklist with colors instead of values.

Hybrid View

  1. #1
    Registered User
    Join Date
    09-03-2021
    Location
    1026 s dorrance st
    MS-Off Ver
    2108
    Posts
    2

    Question Create a picklist with colors instead of values.

    Need to create a picklist that allows choosing from a list of colors but not values. Is this possible? Using Conditional Formatting is not an option since the values in the cells that need to be painted have different values.

    In the attached file you can see example of what I was refering to. I can't post the original one since the data is confidential. In the current picklist there are value options to pick from. I want to chenge that to be only colors refering to the pcklist values. I do not what te value in the cells with the picklist to change.
    Attached Files Attached Files
    Last edited by JanaBackman; 09-07-2021 at 11:00 AM. Reason: Solved

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,691

    Re: Create a picklist with colors instead of values.

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Create a picklist with colors instead of values.

    So do you want the values in column A to stay the same but the background cell colour to change depending on which one of those 3 colours you pick for it?

    In other words If I pick cell 'look into' for cell A1 do you want cell A1 to still show 'some information 1' but have a background colour of that shade of yellow? Or something different?

    If so, this simple piece of code will do what you need (also see attached).

    If the message is too annoying that can be removed. Also you may want to change the colour range and column/range.

    Right click the sheet tab, select 'view code' and paste this macro in the window that appears.

    Option Explicit
    
    Public ColourExpected As Boolean
    Public CellToColour As String
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
    Const ColumnToColour As String = "A:A"
    Const ColourSelection As String = "F1:H4"
    
        
        If Target.Cells.Count > 1 Then Exit Sub
        If Not Intersect(Target, Range(ColumnToColour)) Is Nothing Then
            ColourExpected = True
            CellToColour = Target.Address
            MsgBox ("please select your colour from cells " & Left(ColourSelection, 2) & " through " & Right(ColourSelection, 2))
            Exit Sub
        End If
        If Not Intersect(Target, Range(ColourSelection)) Is Nothing Then
            If ColourExpected Then
                Range(CellToColour).Interior.ColorIndex = Target.Interior.ColorIndex
            End If
        End If
        ColourExpected = False
        CellToColour = ""
    End Sub
    Attached Files Attached Files
    Last edited by Croweater; 09-06-2021 at 09:25 PM.

  4. #4
    Registered User
    Join Date
    09-03-2021
    Location
    1026 s dorrance st
    MS-Off Ver
    2108
    Posts
    2

    Re: Create a picklist with colors instead of values.

    Yes, exactly what I needed!! Thanks.

  5. #5
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: Create a picklist with colors instead of values.

    No problem.

+ 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. How To Create Multi-Select Bounded Picklist
    By Sintax8 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2019, 01:38 AM
  2. [SOLVED] Picklist Chart
    By sjpras in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 09-07-2015, 07:33 AM
  3. how to create drop down list in excel with colors
    By kisanvikas2015 in forum Excel General
    Replies: 3
    Last Post: 05-21-2015, 08:53 AM
  4. AutoUpdate Picklist
    By swalsh^s96 in forum Excel General
    Replies: 3
    Last Post: 04-14-2015, 02:44 PM
  5. [SOLVED] VBA create chart with specific colors
    By lucascaletta in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-22-2014, 07:56 AM
  6. Excel 2007 : How to Lock Down a Picklist
    By lgrigor in forum Excel General
    Replies: 3
    Last Post: 05-18-2012, 08:28 AM
  7. [SOLVED] HOW TO CREATE A BUBBLE CHART WITH CHANGING COLORS?
    By Hector in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-14-2006, 12:45 PM

Tags for this Thread

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