Turning off/on protection in a macro

C

Chip Pearson

Worksheets("Sheet1").Unprotect
or
Worksheets("Sheet1").Unprotect password:="whatever"

If you include the UserInterfaceOnly flag when you Protect the sheet, your
VBA code can do whatever it wants on a protected sheet. E.g.,

Worksheets("Sheet1").Protect UserInterfaceOnly:=True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 

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