willow1985
Well-known Member
- Joined
- Jul 24, 2019
- Messages
- 929
- Office Version
- 365
- Platform
- Windows
Hi everyone,
I have a VBA code that clears conditional formats and then enters them back in for when fellow employees jumble them up so to speak.
The only conditional format I have issues with is the one that states: Cell contains a blank value. I do not know how to write this in VBA
Here is what I want:
and here is what I get (which does not work):
I do not know how to write the code for Cell contains a blank value.
Help with this would be greatly appreciated!
I have a VBA code that clears conditional formats and then enters them back in for when fellow employees jumble them up so to speak.
The only conditional format I have issues with is the one that states: Cell contains a blank value. I do not know how to write this in VBA
Here is what I want:
and here is what I get (which does not work):
I do not know how to write the code for Cell contains a blank value.
VBA Code:
With ThisWorkbook.Worksheets("2023")
With .Range("D3:D11010,F3:F11010").FormatConditions
.Add xlExpression, Formula1:="=LEN(TRIM(A2))=0"
.Item(.Count).Interior.PatternColorIndex = xlAutomatic
.Item(.Count).Interior.ThemeColor = xlThemeColorAccent4
.Item(.Count).Interior.TintAndShade = 0.399945066682943
.Item(.Count).StopIfTrue = False
End With
Help with this would be greatly appreciated!