PC Review

Thread Tools Rate Thread

Protecting worksheet.

Posts: n/a
      17th Aug 2012
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

Reply With Quote
Posts: n/a
      1st Sep 2012

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

ActiveSheet.Protect Password:="guru11"

Reply With Quote

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
protecting formulas without protecting sheet so grouping still wor JM Microsoft Excel Misc 1 4th Jun 2009 06:42 AM
Password Protecting Documents: Not Protecting Header abalboa Microsoft Word Document Management 2 8th May 2008 02:01 PM
Protecting a doc without protecting the header cvirchis Windows XP General 0 27th Jul 2004 05:15 PM
Protecting buttons with VB code rather than protecting sheets/books? StargateFanFromWork Microsoft Excel Programming 2 16th Jul 2004 04:03 PM
protecting formulas w/o protecting worksheet format Michelle Microsoft Excel Misc 2 12th Nov 2003 04:44 AM




All times are GMT +1. The time now is 08:11 AM.