PDA

View Full Version : [SOLVED:] Detecting the Interior Color of a Cell



Cyberdude
03-24-2005, 10:17 AM
I would like to write VBA code that detects what the current interior colorindex of a cell is. The problem is that I can't detect what it is when it is set by a conditional format. Is there a way to do that? To detect the color I use code like the following:

CurrColor = Selection.Interior.Colorindex
This detects the "permanent" color, but not the color that might be present when set by conditional formatting.:dunno

Richie(UK)
03-24-2005, 10:25 AM
Hi C,

Its not quite as simple when looking at CF. However, fortunately somebody has already done a lot of the hard work - have a look at Chip Pearson's site here (http://www.cpearson.com/excel/CFColors.htm).

HTH

mdmackillop
03-24-2005, 10:28 AM
or Byundt's KB article here
http://www.vbaexpress.com/kb/getarticle.php?kb_id=190

Ken Puls
03-24-2005, 10:40 AM
Now how is it that I never found either of those when I was trying to figure out the same thing? :doh:

Cyberdude, thanks for asking this question. Richie, Malcolm, thanks for answering!

mdmackillop
03-24-2005, 10:47 AM
Zack answered it too, but because he's too old and slow, he deleted his late response.:devil:

Zack Barresse
03-24-2005, 10:58 AM
Zack answered it too, but because he's too old and slow, he deleted his late response.:devil:
Hey! I resemble that remark! :p

Ken Puls
03-24-2005, 11:10 AM
Zack answered it too, but because he's too old and slow, he deleted his late response.:devil:
:rotlaugh:

Paleo
03-24-2005, 11:24 AM
Me too, thanks!!


Now how is it that I never found either of those when I was trying to figure out the same thing? :doh:

Cyberdude, thanks for asking this question. Richie, Malcolm, thanks for answering!

Cyberdude
03-24-2005, 02:33 PM
Hey, thanx, guys! Super examples and code. :beerchug:

Paleo
03-24-2005, 04:40 PM
So Cyberdude,

is it solved? If yes, please, mark it solved by clicking on "Thread Tools" -> "Mark Solved".

Thanks.