+ Reply to Thread
Results 1 to 7 of 7

Protect/Un-protect multiple sheets with password using VBA

  1. #1
    Registered User
    Join Date
    01-30-2013
    Location
    India
    MS-Off Ver
    2013
    Posts
    56

    Protect/Un-protect multiple sheets with password using VBA

    Hi There,

    I am working on multiple sheets. I need VBA code to protect the all the sheets by one macro and to un-protect VBA should ask the correct password. Please note that the spreadsheet should have read-only access.

    Please help!!

    Thanks
    Last edited by Max_excel; 08-21-2013 at 05:47 AM.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Protect/Un-protect multiple sheets with password using VBA

    Essentially:
    Please Login or Register  to view this content.
    but you will probably need to tweak/add error handling to suit your needs.

  3. #3
    Registered User
    Join Date
    01-30-2013
    Location
    India
    MS-Off Ver
    2013
    Posts
    56

    Re: Protect/Un-protect multiple sheets with password using VBA

    Hi yudlugar,

    Appreciate your help.

    I have a master password to protect all the sheets e.g test. My requirement is when I run the macro to Protect, the macro should protect the spreadsheets using master password and without a password prompt. And when i run macro to unprotect, it should prompt for correct password i.e test. In your code, any user can protect and un-protect the sheets with their own password.

    Sorry I may not have been clear in my initial post.

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Protect/Un-protect multiple sheets with password using VBA

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-30-2013
    Location
    India
    MS-Off Ver
    2013
    Posts
    56

    Re: Protect/Un-protect multiple sheets with password using VBA

    Many thanks for your help.

    Last one, I need a msgbox to alert if an incorrect password is entered when macro Un-protect is run.

    Regards,

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Protect/Un-protect multiple sheets with password using VBA

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-30-2013
    Location
    India
    MS-Off Ver
    2013
    Posts
    56

    Re: Protect/Un-protect multiple sheets with password using VBA

    Many Many Thanks Yudlugar..

    Can you help me mask the password in this VBA code as well please?
    Last edited by Max_excel; 08-22-2013 at 10:55 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] password protect sheets
    By Velmortis in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-28-2013, 04:32 PM
  2. Replies: 2
    Last Post: 01-17-2013, 08:39 AM
  3. [SOLVED] Password Protect All Sheets Except One.
    By mike1199 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2012, 10:40 AM
  4. Password Protect Multiple Sheets
    By Jonathan78 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-08-2011, 02:27 AM
  5. Replies: 2
    Last Post: 07-16-2005, 11:05 AM

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