Macro protection problems

J

Joe M.

I have about 20 worksheets in a workbook. I am using a macro to protect them
all. One worksheet has a "control" panel with some command buttons. When I
protect the ws containing the control panel, the buttons can still be pushed
even though the cells are protected. Is there a way to protect the buttons
too?

Thanks,
Joe M.
 
D

Dave Peterson

You could disable the commandbuttons on that sheet when you protect the
worksheet that owns them.

With Worksheets("SheetNameHere")
.Protect Password:="hi"
.CommandButton1.Enabled = False
.CommandButton2.Enabled = False
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top