Response to my toggle hide question

  • Thread starter Thread starter Robert Hustead
  • Start date Start date
R

Robert Hustead

Thank you for the response. It works like a real charm, but I forgot
one thing. How would it read if I only want to affect rows 7 through
183? I think it is closing thousands of rows.

Thank you again. This is very helpful!

Bob Hustead
 
Hi bob
Tom's macro only affects the used range. If you only want to affect
specific rows try the following adaption:
Sub togglerows()
Dim rng As Range
Dim cell As Range
Set rng = Activesheet.Range("G7:G183")
For Each cell In rng
If cell.Text = "0" Or cell.Text = "" Then
cell.EntireRow.Hidden = Not cell.EntireRow.Hidden
Else
cell.EntireRow.Hidden = False
End If
Next

End Sub
 
Back
Top