protection with password

B

Bob

I have a macro that turns worksheet protection off before
it runs, then turns it back on after it's done.

Can I embed a password in the macro instructions that
activate and deactivate protection so that a user cannot
just go through the menu to turn off the protection?
 
T

Tom Ogilvy

activesheet.protect Password:="ABCD"

activesheet.unprotect Password:="ABCD"

look in excel vba help for other arguments to protect and unprotect.

Also, try recording a macro while you do it manually (assigning a password
as well).
 

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