Hello,
I am trying to create a macros that will shade all cells in column "E" that has "0" or is blank, in each worksheet. I used this macros below but for some reason it is not working...it will run without errors but nothing will happen....
Sub DoBlankCells()
Dim Cell As Range
Dim RegExp As Object
Dim Rng As Range
Dim Wks As Worksheet
Set RegExp = CreateObject("VBScript.RegExp")
RegExp.Global = False
RegExp.IgnoreCase = True
RegExp.Pattern = "^0.*"
For Each Wks In ActiveWorkbook.Worksheets
Set Rng = Wks.Range("E1", Wks.Cells(Rows.Count, "E").End(xlUp))
For Each Cell In Rng
If RegExp.Test(Cell) = True Then
Cell.EntireColumn.Interior.Pattern = xlSolid16
End If
Next Cell
Next Wks
Set RegExp = Nothing
End Sub
any suggestions?
Thank you in advance for your help!
Bookmarks