![]() |
Is there is a way to tell conditional formatting is on?
I want to if I can tell conditianl formatting is turned on in the VBA?
Thanks. |
Is there is a way to tell conditional formatting is on?
Hi
If range("A1").FormatConditions.Count 0 then msgbox "conditional formating applied for cell A1" end if -- Regards Frank Kabel Frankfurt, Germany luvgreen wrote: I want to if I can tell conditianl formatting is turned on in the VBA? Thanks. |
Is there is a way to tell conditional formatting is on?
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. |
Is there is a way to tell conditional formatting is on?
Since you know the condition, just use that:
Dim CFisOn As Boolean CFisOn = Range("A1").Value = 1 In article , "luvgreen" wrote: 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. |
Is there is a way to tell conditional formatting is on?
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. |
Is there is a way to tell conditional formatting is on?
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. -- Regards Frank Kabel Frankfurt, Germany luvgreen wrote: 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. |
Is there is a way to tell conditional formatting is on?
Thank you for the reply. I really appreciate all your help.
|
All times are GMT +1. The time now is 01:18 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com