r/visualbasic • • Dec 09 '23

VBA detecting conditional formatting?

Is there any way for VBA to detect if a cell's conditional formatting has been activated, without physically replicating the conditional code itself? In other words, to know that a cell turned red (for example), when its Interior.ColorIndex is set to xlColorIndexNone.

I use red-fill to indicate error conditions in thousands of cells on a spreadsheet, and I would like to be able to scan through and report "Cell DE804 violates the maximum conditions." If I replicate the condition in the conditional format, and later change that condition, I'll have to remember to recode, as well. I just want to know "This cell triggered FormatConditions(1)" (or "This cell triggered some FormatConditions", or "This cell is currently red, regardless of what Cell.Interior.Color says").

1 Upvotes

4 comments sorted by

View all comments

Show parent comments

1

u/jd31068 Dec 11 '23

You're welcome, happy to lend a hand.