+ Reply to Thread
Results 1 to 6 of 6

How to identify cell colour

  1. #1
    Forum Contributor
    Join Date
    08-22-2005
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    349

    How to identify cell colour

    I have a sample of colours arranged such that each one is shown as the background fill colour for a cell. Now I want to identify each of these colours by its RGB-code taken from the cell.
    The slow thing to do is click format-cells - fill - more colors - custom and then write down what it says, but I imagine there could be a smarter solution to this. Perhaps some function - something like COLORID(A1); yes I know it doesn't exist, but I suppose you get the meaning - that reveals the RGB combination - or perhaps a macro can do it.

    Anyone with a suggestion?

    best regards NSV

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: How to identify cell colour

    Do you need the individual R, G and B values, or just the equivalent number?
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to identify cell colour

    Hi

    Take a look to this.

    http://www.cpearson.com/excel/Colors.aspx
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Forum Contributor
    Join Date
    08-22-2005
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    349

    Re: How to identify cell colour

    @Fotis
    Thanks for the suggestion - I'll take a closer look at the cpearson page.

    @romperstomper
    I am trying to create a function that can change the background colour of a cell based on the name of a colour if typed into the cell, e.g. RAL 5017 will change the backgound to blue or RAL 2005 to hot red. If I can only dechipher the RGB value from the sample cells I imagine I can continue to make a macro that can paint the cells based on the values.
    I haven't come so far as to find out whether VBA requires the individual codes or the 'equivalent number', whatever that is?

    NSV
    Last edited by nsv; 06-25-2014 at 06:59 AM.

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: How to identify cell colour

    If you just want to assign the fill from one cell to another, you only need the compound value (RGB returns values between 0 and 16777215) - for example:
    Please Login or Register  to view this content.
    If you want to determine the interior colour of a cell using a function:
    Please Login or Register  to view this content.
    but be aware that if you use this in a cell, it will not update when you change the fill colour of the specified cell, but only when the workbook is recalculated for any reason.

  6. #6
    Forum Contributor
    Join Date
    08-22-2005
    Location
    Denmark
    MS-Off Ver
    Excel 365
    Posts
    349

    Re: How to identify cell colour

    'Cell.Interior.Color' - thanks romperstomper, I think I can continue now.

    NSV

+ 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 identify/reproduce a Fill colour
    By Motox in forum Excel General
    Replies: 2
    Last Post: 10-06-2013, 06:15 AM
  2. Replies: 1
    Last Post: 09-12-2013, 02:09 PM
  3. Identify colour of picture
    By yellowpower in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-16-2011, 09:21 AM
  4. Colour change column chart based on cell colour
    By Alice21 in forum Excel General
    Replies: 11
    Last Post: 04-05-2011, 10:10 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