macro to unlock worksheet

K

Kirsty

I want my macro to unlock the worksheet before it runs, and then lock it
again after.

At the moment I have Sheets("Daily Report").Select
wsheet.Unprotect Password:="computer"

however this is getting an error.

Any suggestions?
 
M

Mike H

Kirsty,

Do it like this

Sheets("Daily Report").Unprotect Password:="computer"
'do things
Sheets("Daily Report").Protect Password:="computer"

Mike
 
K

Kirsty

thanks, works perfectly

Mike H said:
Kirsty,

Do it like this

Sheets("Daily Report").Unprotect Password:="computer"
'do things
Sheets("Daily Report").Protect Password:="computer"

Mike
 
Top