Is there a way to test if a cell has a certain conditional formatting color in code?
Is there a way to test if a cell has a certain conditional formatting color in code?
Peace of mind is found in some of the strangest places.
Why don't you just use the condition?
It is possible, but not easy.Originally Posted by austenr
See http://www.xldynamic.com/source/xld.CFConditions.html
hello
plese show an example.
moshe
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
Peace of mind is found in some of the strangest places.
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?
Peace of mind is found in some of the strangest places.
Hi Austen,
Uh, are you talking about "A1<>B1" type of CF formula?
Regards, Zack Barresse
Check out the KB! :|: BOARD TAGS: WHAT ARE THEY AND HOW DO I USE THEM
What is a Microsoft MVP? | Free Microsoft Courses | My Book on Excel Tables
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
Peace of mind is found in some of the strangest places.
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.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.
Peace of mind is found in some of the strangest places.
So count themOriginally Posted by austenr
=COUNTIF(1:1,">10)>0