Hi all,
I have a workbook that contains lots of worksheets including 12 names after each month. I have a named range which refers to this list called Months. I am trying to run a macro that cycles only through the worksheets listed in 'Months' and then hides rows where the value = 0. The issue is it does not seem to cycle through the worksheets. any help would be appreciated:
I have a workbook that contains lots of worksheets including 12 names after each month. I have a named range which refers to this list called Months. I am trying to run a macro that cycles only through the worksheets listed in 'Months' and then hides rows where the value = 0. The issue is it does not seem to cycle through the worksheets. any help would be appreciated:
Code:
Sub months()
Application.ScreenUpdating = False
Dim rl As Range
Dim v As Range
For Each v In Range("Months")
For Each rl In Range("B15:B44")
If rl.Value = "" Then
rl.EntireRow.Hidden = True
End If
Next rl
Next v
Application.ScreenUpdating = True
End Sub