I'm looking to have a macro that will hide all rows where the cell in column B of that row is blank. The formulas in those cells are returning "" if there isn't a calculated value. I'd like that macro to also unhide all rows if there are currently rows hidden in the range. However, I'm having trouble simply getting the rows to hide. I tried the following:
Sub ToggleHide()
If Range("B:B").Value = "" Then
Rows("2:200").EntireRow.Hidden = True
Else: Rows("2:200").EntireRow.Hidden = False
End If
End Sub
That didn't work, so I thought "" might be returning as Null and tried the following, which also did not work.
Sub ToggleHide()
If IsNull(Range("B:B").Value) Then
Rows("2:200").EntireRow.Hidden = True
Else: Rows("2:200").EntireRow.Hidden = False
End If
End Sub
Any suggestions?
Bookmarks