Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,533
- Office Version
- 365
- 2016
- Platform
- 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.
How can disable the conditional formatting of that cell?
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?