Results 1 to 5 of 5

Create a picklist with colors instead of values.

Threaded View

  1. #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.

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