View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
George Avery
 
Posts: n/a
Default Include a password in VB code.

flummi wrote:

Su


Worksheets("xyz").Unprotect (PW)
Worksheets("xyz").Protect (PW)


Or


Activesheet.Unprotect (PW)
ActiveSheet.Protect (PW)


Or from the main menu:


Tools--Protection--Protect sheet


Hans


Vielen Dank Hans,

Why is it that you always find the answer just after you've posted rather
than just before 8^)

Just to add to your post - I found that I had to use double quotes in the
password e.g.
Worksheet.Unprotect ("PW")

GA