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")
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