Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

Displaying the color index of a cell

Want i'm trying to accomplish is:
In column A I have multiple cells with different colors in them in column B I wanted the color index of each colored cell, for example.
If column A cell A1 is red I wanted in column B, B1 to display 3 and so on.
0
SOUTHAMERICA70
Asked:
SOUTHAMERICA70
  • 3
  • 2
  • 2
1 Solution
 
Patrick MatthewsCommented:
Hello SOUTHAMERICA70,

Chip Pearson has numerous code examples showing
how to evaluate cell colors.

If the coloring is due to "normal" formatting:

http://www.cpearson.com/excel/colors.htm

If the coloring is from Conditional Formatting:

http://www.cpearson.com/excel/CFColors.htm


Regards,

Patrick
0
 
Dave BrettVice President - Business EvaluationCommented:
You can use XLM and range name workarounds for this (ie no VBA)
  1. Select Cell B1
  2. Insert a range name
     
         CellColour
=GET.CELL(63,A1)
       3. in B1 put  =CellColour+RAND()*0
       4. copy down

see attached file

     


cc.xls
0
 
Patrick MatthewsCommented:
Dave,

Brilliant!

Patrick
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Dave BrettVice President - Business EvaluationCommented:
thx Patrick, I had missed your earlier post

although new Excel security updates now flag XLM use, so the invisible macro is getting hard to use :)

Dave
0
 
SOUTHAMERICA70Author Commented:
Quick question...how do I use XLM?
0
 
Dave BrettVice President - Business EvaluationCommented:
It is used automatically by the range name, ie the
=GET.CELL(63,A1
portion is using a XLM formula to retrieve the cell backgrund colour (63 is the colour code)

Cheers
Dave
0
 
SOUTHAMERICA70Author Commented:
Got it.  Thanks.  Also I created a new excel sheet but when I place the  =CellColour+RAND()*0 in the cell I get a #NAME? error.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now