Unlocking and Locking in a Marco

J

JBoyer

I have a marco that will only work if the sheet is unprotected. Can I make my
marco unlock the sheet in the beginning and then lock it when completed. Hope
you can help!
 
M

Mike

try this
worksheets("Sheet1").unprotect "password"
'run your code here
worksheets("Sheet1").protect "password"
 

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