View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Trevor Shuttleworth Trevor Shuttleworth is offline
external usenet poster
 
Posts: 1,089
Default Command Button not working once sheet is protected

Tom

Rows(1).Delete ? Maybe a bit radical for hiding a row ?

Janice

one way:

Private Sub CommandButton1_Click()
'Toggle the Hidden Status for Row 1
ActiveSheet.Unprotect Password:="ABCD"
Rows(1).Hidden = Not Rows(1).Hidden
ActiveSheet.Protect Password:="ABCD"
End Sub

Regards

Trevor


"Tom Ogilvy" wrote in message
...
Private Sub CommandButton1_Click()
ActiveSheet.Unprotect Password:="ABCD"
Rows(1).Delete
Activesheet.Protect Password:="ABCD"
End Sub

109 to go.
--
Regards,
Tom Ogilvy

"Janice" wrote in message
...
I have created an Excel template used for data entry. I
have added command button with a macro behind it to hide
and unhide rows. However, once I protect the worksheet so
that the user cannot make changes, the command button
won't work. HELP! I created 110 of these silly things
and now they don't work!