Password protection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone help me write 2 macros to turn on and turn off password
protection? I want to be able to add these to macros I already have so that
the user doesn't get the enter password screen. For arguments sake, the
password is "monkey".

Thanks,

Nick
 
Hi Nick,

sub Unprotect
dim ws as worksheet
for each ws in activeworkbook.worksheets
ws.unprotect "monkey"
next ws
end sub

sub Protect
dim ws as worksheet
for each ws in activeworkbook.worksheets
ws.protect "monkey"
next ws
end sub

Regards,
Ivan
 

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

Back
Top