Trying to figure out how to write code such that If ALL the cells in a range, say (B4:Z4), are blank then hide the row. I need this to be applied to multiple ranges however, not just that specific range.
Idea is something like:
Sub HideRows()
For k = 4 To 40
IF All cells in Range ("B(k):Z(k)") = ""
Then
EntireRow.Hidden = True
Else
EntireRow.Hidden = False
Next k
End Sub
Fairly new to coding so not sure if I'm close or not... Any help is greatly appreciated!
Idea is something like:
Sub HideRows()
For k = 4 To 40
IF All cells in Range ("B(k):Z(k)") = ""
Then
EntireRow.Hidden = True
Else
EntireRow.Hidden = False
Next k
End Sub
Fairly new to coding so not sure if I'm close or not... Any help is greatly appreciated!