Is there is a way to tell conditional formatting is on?

  • Thread starter Thread starter luvgreen
  • Start date Start date
Hi

If range("A1").FormatConditions.Count >0 then
msgbox "conditional formating applied for cell A1"
end if
 
Thank you for reply. I did not express my question well. Let me explain it with an example.

For cell A1 I put condition formatting of if A1=1, then shade the cell in red. I want to know if the cell is turned red or not. Thanks.
 
Since you know the condition, just use that:

Dim CFisOn As Boolean
CFisOn = Range("A1").Value = 1
 
Thank you for all replies. In my case, many cells have different conditional formattings. Is there a way to tell that any of the conditional formattting is on? I am sorry to keep repeating this question.

I tired to use the range.interior.colorindex to see if the color is changed, but it seems the interior color did not change even when the conditional formatting is on. How can I tell the color is changed in the cell from the code which going through each cell with the conditions applied to the cell? Thanks a lot.
 
Hi
Unfortunately you cannot check the conditional format color. So AFAIK
you have to 're-code' all your conditions for all cells in VBA to check
whether a condition is evaluated to True or False.
 
Back
Top