+ Reply to Thread
Results 1 to 3 of 3

VBA code to unlock password protected worksheets

  1. #1
    Registered User
    Join Date
    11-13-2019
    Location
    England
    MS-Off Ver
    office 2016
    Posts
    1

    Post VBA code to unlock password protected worksheets

    Hello,

    I have created a spreadsheet which is password protects worksheets individually- however each time I want to change something on the spreadsheet it asks me the password to that worksheet- how can I create a macro which un protects all worksheets that have a password? I would like this macro to prompt for a password before it unlocks all worksheets.

    Thank you

  2. #2
    Valued Forum Contributor PaulSP8's Avatar
    Join Date
    11-21-2017
    Location
    Chorley, England
    MS-Off Ver
    2013 & 2021
    Posts
    437

    Re: VBA code to unlock password protected worksheets

    Hello and Welcome to the Forum

    You can do something like this;

    Please Login or Register  to view this content.
    (Using Sheet1.Protect Passworld:="Pa55w0rd" to protect them again once you're done)

    But if your security is paramount then you'd need to protect the VBA as well (Right Click > VBA Project Properties > Protection)

    Hope that helps

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: VBA code to unlock password protected worksheets

    This will unprotect and protect a sheet, but ignore a specific sheet, this example assumes sheet1 is the sheet to ingore.

    Please Login or Register  to view this content.
    Last edited by davesexcel; 11-13-2019 at 09:04 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to unlock protected workbook - Forgot password
    By ax2018 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2018, 09:53 PM
  2. Unlock a password protected WORKBOOK
    By subbby in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-02-2015, 11:31 AM
  3. Marco to unlock my password protected workbook.
    By 11linc11 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2013, 07:44 PM
  4. Excel 2007 : How to unlock if protected the password
    By vijayadevan in forum Excel General
    Replies: 3
    Last Post: 02-06-2012, 03:04 AM
  5. VBA to unlock password protected sheet using cmd button
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-18-2011, 03:27 PM
  6. [SOLVED] How do I unlock a protected worksheet:password protected
    By Terry Swift in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-01-2005, 09:05 PM
  7. [SOLVED] How do I unlock a spreadsheet that is password protected?
    By Moke in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-25-2005, 11:06 PM

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