Hey

I am a beginner at this so please excuse a seemingly silly question but I have activex control buttons which hide and unhide certain rows, however once I protect the worksheet I receive the following error:

Run-time error '1004':
Unable to set the Hidden property of the Range class.

This is the VBA Code:

Private Sub CheckBox1_Click()

End Sub

Private Sub CommandButton1_Click()
With Rows("24:30")
.Select
.EntireRow.Hidden = Not .EntireRow.Hidden
End With
End Sub

Private Sub CommandButton2_Click()
With Rows("31:36")
.Select
.EntireRow.Hidden = Not .EntireRow.Hidden
End With
End Sub

Private Sub CommandButton3_Click()
With Rows("48:57")
.Select
.EntireRow.Hidden = Not .EntireRow.Hidden
End With
End Sub

Any ideas? Thank you in advance!