Disregard The Conditional Formatting Rules of A Cell

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a dataset whose cells are formatted conditionally. However, over the course of my VBA application, the values of these cells may change change which in turn changes the rules of the conditional formatting.

For example, a cell contains a person's name, Peter. A conditional format rule says if that cell not equal <> "Peter", to shade the cell grey. The background is unchanged as long as the cell remains equal to Peter.

At a point in the code, the value Peter, changes to a time. As the cell no longer equal's Peter, the cell becomes shaded. I don't want it to. I put in my code a line to change the background to white, but I think the conditional formatting trumps that.

Rich (BB code):
For t = sr To ilrdata
        If .Range("Q" & t) = pristaff Then
            .Range("Q" & t) = Format(Application.VLookup(.Range("A" & t), rcore, 61, False), "h:mm")
            .Range("Q" & t).Font.Color = vbBlack
            .Range("Q" & t).Font.Size = 6
            .Range("Q" & t).Interior.Color = RGB(255, 255, 255)
        End If

How can disable the conditional formatting of that cell?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Just set up two conditional formats, no VBA required
One to check for Peter, shade cell grey
One to check for a time, format as required
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,702
Members
449,048
Latest member
81jamesacct

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