simora
06-20-2010, 05:01 PM
I'm trying to loop through a range and hide the column where the active cell is located if the column value is < 1 or "" or $0.00
This is the code that I have. It does not delete the columns even though the value is 0
Dim MyCell As Range, MyRange As Range
Set MyRange = Range("M204:U204")
For Each MyCell In MyRange
If MyCell.Value < 1 Or MyCell.Value = "" Then
ActiveCell.EntireColumn.Hidden = True
End If
Next MyCell
Can anyone tell me why this code is not hiding the column
Thanks
This is the code that I have. It does not delete the columns even though the value is 0
Dim MyCell As Range, MyRange As Range
Set MyRange = Range("M204:U204")
For Each MyCell In MyRange
If MyCell.Value < 1 Or MyCell.Value = "" Then
ActiveCell.EntireColumn.Hidden = True
End If
Next MyCell
Can anyone tell me why this code is not hiding the column
Thanks