View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default need a macro to lock sheet

Activesheet.Protect Password:="ABC"

Activesheet.Unprotect Password:="ABC"

are the commands.

Just another thought.
You need to save the workbook before closing if you want them to be in
effect when you open it.

--
Regards,
Tom Ogilvy


"dgr" wrote:

I would like a simple macro that inserts my password into the 2 protection
fields when locking the sheet.
When I go to unprotect the sheets the file doesn't ask for the password?