+ Reply to Thread
Results 1 to 6 of 6

Using a macro to unprotect a sheet

  1. #1
    Registered User
    Join Date
    03-14-2008
    Posts
    45

    Using a macro to unprotect a sheet

    I've been able to get a macro to unprotect a sheet that doesn't have a password and re-protect it without a password.

    Please Login or Register  to view this content.

    However, If a password is placed on a sheet, is there a way to use VBA to unprotect and re-protect using that password?

    Thanks!
    Last edited by adr150; 03-25-2010 at 02:25 PM.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Using a macro to unprotect a sheet

    Good evening adr150

    Sure.
    Please Login or Register  to view this content.
    will protect the worksheet.

    Please Login or Register  to view this content.
    will unprotect it again.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Registered User
    Join Date
    10-02-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Using a macro to unprotect a sheet

    Try this, Crerate a sheet called password. Enter the password into cell A1 and use the following code / macros's to protect and unprotect worksheets. You may want to unlock cell A1 in password spreadsheet so that you can remove it once protected.

    Regards, Mike

    Please Login or Register  to view this content.
    regards, Mike

  4. #4
    Registered User
    Join Date
    03-14-2008
    Posts
    45

    Re: Using a macro to unprotect a sheet

    nice, thanks guys!

    that's a pretty cool idea Mike. How would you apply it to just 'Sheet2' and 'Sheeet3' but not 'Sheet1'?

  5. #5
    Registered User
    Join Date
    03-14-2008
    Posts
    45

    Re: Using a macro to unprotect a sheet

    also, what if Sheet2 and Sheet3 are hidden? how would you code to unhide them?

  6. #6
    Registered User
    Join Date
    10-02-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Using a macro to unprotect a sheet

    Hi, Glad you like it try this for single sheets:


    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1