-
Thank you, works like a charm. I took your code and inserted it into the CommandButton1 code to hide/unhide the data tabs when the sheets are protected/unprotected.
Edit: On a side note, is there a way to hide/unhide a command button based on the sheet being protected/unprotected? Right now I am cheating with this code, but I am afraid that if I forget to hide it, people would be tempted to click on it.
[VBA]
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Address <> "$P$1" Then Exit Sub
ActiveSheet.Shapes("CommandButton5").Visible = Not ActiveSheet.Shapes("CommandButton5").Visible
[B1].Select
End Sub
[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules