mardi 15 août 2017

Hiding non-contiguous rows in excel using checkboxes

I am trying to hide several non-contiguous rows in excel using checkboxes. I have had success in hiding rows that are next to each other, but not a range of rows that are not. Here is my code that doesn't work:

Private Sub CheckBox6_Click()

If CheckBox6 = True Then


Range("Report!45:45,Report!46:46,Report!48:48,Report!50:50").EntireRow.Hidden = False

Else: [Report!45:51].EntireRow.Hidden = True

End If

End Sub

Any help would be much appreciated! Thank you!




Aucun commentaire:

Enregistrer un commentaire