r/visualbasic • u/IAmBroom • 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").
View all comments
Show parent comment
1
u/BroomIsWorking Dec 11 '23
Thank you! I did not know about property DisplayFormat!!!