VBA to turn off conditional formatting

thedeadzeds

Active Member
Joined
Aug 16, 2011
Messages
451
Office Version
  1. 365
Platform
  1. Windows
Guys,

Is it possible to turn off a a specific part of the condition formatting? For example, range $H$2:$NH$27 Contains the following:

When the Cell value contains 'sick' then change the background yellow and font black.

So bascially i would like to have a button that i can click to turn this part of the conditional formatting on or off (but not effect any other conditional formatting applied to those cells). Initial thoughts are this can't be done but would like to check.

Thanks
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi, you could use a cell on a hidden sheet that is used along with your rule to determine if the condition should be applied - you could then alter the value of that cell with your button.

For example, you could have a hidden sheet called "Settings" and change your conditional formatting rule to the "Use a formula" method and use this formula.

=AND(H2="Sick",Settings!$A$1=0)

Then changing the value of settings!A1 to anything other than zero/blank would negate the CF rule.
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top