Protecting worksheet.

Discussion in 'Microsoft Excel Programming' started by richard.mogy@gmail.com, Aug 17, 2012.

  1. Guest

    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
     
    , Aug 17, 2012
    #1
    1. Advertisements

  2. Guest

    Rich,

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

    ActiveSheet.Protect Password:="guru11"

    -Ben
     
    , Sep 1, 2012
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jimmy Ho

    Protecting a worksheet from veiwing but not from importing in data

    Jimmy Ho, Jul 10, 2003, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    552
    HarlanĀ Grove
    Jul 10, 2003
  2. Trish

    Protecting a worksheet

    Trish, Mar 12, 2004, in forum: Microsoft Excel Programming
    Replies:
    1
    Views:
    202
    Frank Kabel
    Mar 12, 2004
  3. Brad E

    Options when Protecting Worksheet

    Brad E, Apr 9, 2004, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    182
    Frank Kabel
    Apr 9, 2004
  4. Guest

    Protecting worksheet

    Guest, Apr 27, 2004, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    154
    Tom Ogilvy
    Apr 27, 2004
  5. StargateFanFromWork

    Protecting buttons with VB code rather than protecting sheets/books?

    StargateFanFromWork, Jul 15, 2004, in forum: Microsoft Excel Programming
    Replies:
    2
    Views:
    298
    StargateFanFromWork
    Jul 16, 2004
Loading...

Share This Page