Is there a way to test if a cell has a certain conditional formatting color in code?
Printable View
Is there a way to test if a cell has a certain conditional formatting color in code?
Why don't you just use the condition?
It is possible, but not easy.Quote:
Originally Posted by austenr
See http://www.xldynamic.com/source/xld.CFConditions.html
hello
plese show an example.
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
Thanks Matt, Bob
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?
Hi Austen,
Uh, are you talking about "A1<>B1" type of CF formula?
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.Quote:
Originally Posted by austenr
But if you just want to identify the row, why not CF the whole row based upon one or two cells.
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 themQuote:
Originally Posted by austenr
=COUNTIF(1:1,">10)>0