Protecting worksheet.

  • Thread starter Thread starter richard.mogy
  • Start date Start date
R

richard.mogy

I have used the following code to protect a worksheet while leaving certain cells unprotected.

Range("bi" & RowNum & ":cn" & UnprotectLastRow).Locked = False
Range("bk" & RowNum & ":bw" & UnprotectLastRow).Locked = True

ActiveSheet.Protect Password = "guru11"

I would like the manager to be able to unprotect the workbook within Excel. When I go into Review-->Unprotect sheet. It asks for a password. I provide the password above and it doesn't like it.

Am I going to the wrong place for this?

If so, where should I go?

If not, what do I need to do?

Thanks in Advance

Rich
 
Rich,

You are missing a colon after Password. This line worked for me:

ActiveSheet.Protect Password:="guru11"

-Ben
 
Back
Top