Im creating a dictionary in Exel and would like a show hide button. At the moment it works fine but my cells are static. I have a row titled B on row 7, and C on row 12. If I add a row in between then obviously the button wont work properly. How do I adjust the code below to say "show or hide all rows between "B" and "C"
Private Sub CommandButton2_Click()
Dim myRng As Range
Set myRng = Me.Range("b8:b11")
myRng.EntireRow.Hidden = Not (myRng(1).EntireRow.Hidden)
End Sub
Bookmarks