View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default Unlocking and Locking in a Marco

try this
worksheets("Sheet1").unprotect "password"
'run your code here
worksheets("Sheet1").protect "password"

"JBoyer" wrote:

I have a marco that will only work if the sheet is unprotected. Can I make my
marco unlock the sheet in the beginning and then lock it when completed. Hope
you can help!