Help with a Macro to evaluate ConditionalFormatting Rule

lucaslavia

New Member
Joined
Oct 13, 2010
Messages
1
Hi,
This particular project has me stumped. I'm trying to design a macro which loops through a range and checks whether the cell fill is red, it would then paste the cell address in another sheet. That part is all fine, the problem is that the cell is highlighted red as a result of a conditional formatting rule.
My first thought was to create a function to check if a conditional formatting rule was active on a the cell in question, I can only get this to work for rules which use an operator rather than a formula.
My question is, is there a method to parse the formula from a conditional formatting rule into VBA, evaluate it and complete the macro based on the result? i.e.

Dim d as FormatCondition

For each c in Range("A1:D10")
Set d=range(c.address).formatconditions(1)​
If evaluate(d.formula1)=True then​
...​
End if​
Next
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,214,979
Messages
6,122,560
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top