Hi everyone
I have been using the below code to automatically hide rows based on if a cell is = 0. This works fine as I'm hiding the data on the same worksheet, but now I am using the button on my main worksheet but want to hide rows on another worksheet called 'Hidden' in the same workbook.
Please can someone help me where and how I set the name of the worksheet that I want rows to be hidden?
Thank you so much
I have been using the below code to automatically hide rows based on if a cell is = 0. This works fine as I'm hiding the data on the same worksheet, but now I am using the button on my main worksheet but want to hide rows on another worksheet called 'Hidden' in the same workbook.
Please can someone help me where and how I set the name of the worksheet that I want rows to be hidden?
Code:
Dim xRg As Range Application.ScreenUpdating = False
For Each xRg In Range("I22:I45")
If xRg.Value = "0" Then
xRg.EntireRow.Hidden = True
Else
xRg.EntireRow.Hidden = False
End If
Next xRg
Application.ScreenUpdating = True
Thank you so much