I have a spreadsheet wherein I want to hide all rows in a set range if the the value in that row, column Y = "HIDE".
Below is the code I have written. I have a command just before this which sets My Range, depending on the value of a certain cell. Can anyone tell me why this does not work?
If MyRange.Address <> "$A$1" Then
For Each Cell In MyRange
Rows(Cell.Row).Hidden = UCase(Cell.Value) = "HIDE"
Next Cell
End If
Below is the code I have written. I have a command just before this which sets My Range, depending on the value of a certain cell. Can anyone tell me why this does not work?
If MyRange.Address <> "$A$1" Then
For Each Cell In MyRange
Rows(Cell.Row).Hidden = UCase(Cell.Value) = "HIDE"
Next Cell
End If