Automatic Password Protect Sheet


L

Lorcan Dene

I've coded a button to open a file, copy some info from 1 sheet to another,
but i need the button to first unprotect the sheet, then do its copying, then
protect the sheet when finsihed.

i've tried:

Worksheets("Sheet1!").Protect (password)
and hence
WorkSheets("Sheet1!").UnProtect (password)

but it doesnt password protect it, only protects it normally, anyone help
please?
 
Ad

Advertisements

G

Gord Dibben

Sheets("Sheet1").Unprotect Password:="justme"

your code to do things

Sheets("Sheet1").Protect Password:="justme"


Gord Dibben MS Excel MVP
 

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