Hi,
I currently have a VBA script that hides the rows on a worksheet if that row has the text "Hide" within the range A5:A100. I am trying to adapt it to automatically do this on every worksheet at once.
This is where I am at (which is not working):
Sub Hide_Zero_Rows()
Dim sht As Worksheet
For Each sht In Worksheets
For Each cell In sht.Range("A5:100")
If cell.Value = "Hide" Then
cell.EntireRow.Hidden = True
Else
cell.EntireRow.Hidden = False
End If
Next cell
Next sht
End Sub
Your help would be appreciated!
Cheers
I currently have a VBA script that hides the rows on a worksheet if that row has the text "Hide" within the range A5:A100. I am trying to adapt it to automatically do this on every worksheet at once.
This is where I am at (which is not working):
Sub Hide_Zero_Rows()
Dim sht As Worksheet
For Each sht In Worksheets
For Each cell In sht.Range("A5:100")
If cell.Value = "Hide" Then
cell.EntireRow.Hidden = True
Else
cell.EntireRow.Hidden = False
End If
Next cell
Next sht
End Sub
Your help would be appreciated!
Cheers