Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

retrieve color conditional format cell - excel 2007

Status
Not open for further replies.

wekkew

Programmer
Sep 28, 1998
123
GB

hi, what i need to do is to "read" the color of a cell that's been formatted with a conditional format. As you know,
activecell.interior.colorindex returns the NON conditional formatted colour.

All the solutions I've seen involve checking for the format conditions again and deducing the colour from that. I've used a top/bottom rank % format so I'm trying to avoid going down that road.

Surely the CF colour is stored somewhere!!??

ta
 



Hi,

Have you tried using your macro recorder to record setting a CF. It is very instructive.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 

I've already written the CF in vba - what I'm trying to do now is to READ the colour that's been applied to cells.
 



The you know what the properties and constants are.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Unless 2007 is completely different than any other version of excel in this then there is no way to "Read" the colour that has been applied to the cells - the reason for this is simple, the colour set is the result of a piece of logic. Excel determines the colour by using the logic therefore so must you

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
To further elaborate, you can read the colours that are applicable to each condition should it be met but you would still have to figure out which condition has been met in order to logically deduce which colour is going to be used...



Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Bottom line, you knew it:
All the solutions I've seen involve checking for the format conditions
 
back to the basics: WHY do you need to "read" the "Color"? The only reason which comes to mind is to select the record(s) according to the Logic which imposed the "Color". since you "know" the logic, just use it in the selection criteria. It SEEMS like a relaticely trivial exercise to place this logic in a "cell" with slight modification to set the value as opposed to the ".InteriorColor"?

So, to
PHV said:
" ... Bottom line, you knew it:
... "

or to rephrase it "quit whining and just do it"



MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top