PDA

View Full Version : Conditional formatting color question



austenr
01-24-2006, 09:51 AM
Is there a way to test if a cell has a certain conditional formatting color in code?

Norie
01-24-2006, 10:18 AM
Why don't you just use the condition?

Bob Phillips
01-24-2006, 10:20 AM
Is there a way to test if a cell has a certain conditional formatting color in code?
It is possible, but not easy.

See http://www.xldynamic.com/source/xld.CFConditions.html

lior03
01-24-2006, 10:20 AM
hello
plese show an example.

mvidas
01-24-2006, 10:23 AM
Austen,

Take a look at http://www.vbaexpress.com/kb/getarticle.php?kb_id=190 and http://www.cpearson.com/excel/CFColors.htm
You should be able to get the info you need from there! Let us know if you need any help.

Matt

austenr
01-24-2006, 10:39 AM
Thanks Matt, Bob

austenr
01-24-2006, 10:45 AM
Ok. Maybe there is another option. Is there a way using a formula to set the font to a different color if two cells are not the same value?

Zack Barresse
01-24-2006, 10:52 AM
Hi Austen,

Uh, are you talking about "A1<>B1" type of CF formula?

austenr
01-24-2006, 12:13 PM
Hey Zack,

Yes. Something that will change the color of the font. But having said that, to something you can test the cell on. Since you can not do it easily with the colors supplied by CF. What I want to end up doing is identifying rows where cells are a different color which would work off of some match or index function in combination with maybe an IF formula.

Example:

If B1 <> A1 change B1 to font color red. Then be able to select that row based on the color of the font in B1. HTH

Bob Phillips
01-24-2006, 12:25 PM
Hey Zack,

Yes. Something that will change the color of the font. But having said that, to something you can test the cell on. Since you can not do it easily with the colors supplied by CF. What I want to end up doing is identifying rows where cells are a different color which would work off of some match or index function in combination with maybe an IF formula.

Example:

If B1 <> A1 change B1 to font color red. Then be able to select that row based on the color of the font in B1. HTH

You can use CF to set the colour based on a condition, that is what CF is, but you won't get a function that to identify that.

But if you just want to identify the row, why not CF the whole row based upon one or two cells.

austenr
01-24-2006, 12:46 PM
That wont work because I am examining each cell on the row. If any cell is <> to the test condition then you could CF the whole row.

Bob Phillips
01-24-2006, 12:50 PM
That wont work because I am examining each cell on the row. If any cell is <> to the test condition then you could CF the whole row.

So count them

=COUNTIF(1:1,">10)>0