+ Reply to Thread
Results 1 to 12 of 12

Password lock for Worksheet in a excel workbook

  1. #1
    Registered User
    Join Date
    07-26-2014
    Location
    Hong Kong
    MS-Off Ver
    Office 2010
    Posts
    24

    Password lock for Worksheet in a excel workbook

    I am currently using a script that I can set user name and password in a excel workbook that allow users to view only one assigned worksheet. Can anyone help to adjust the code so that one user can view multiple sheets?

    heres the code im using.

    Please Login or Register  to view this content.
    Mod note: code tags added for you - this time
    Last edited by z3162238; 10-16-2014 at 06:46 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Password lock for Worksheet in a excel workbook

    So one user can view ALL sheets, or each user can view specific other sheets out of all possible sheets?

    Here's a page outlining either option:

    Password Protect Hidden Sheets or Password Protect Sets of Hidden Sheets.
    Last edited by JBeaucaire; 12-26-2019 at 04:54 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-26-2014
    Location
    Hong Kong
    MS-Off Ver
    Office 2010
    Posts
    24

    Re: Password lock for Worksheet in a excel workbook

    I want a user able to view multiple sheets heres the file im usingExcel with Password lock.xlsm
    Last edited by JBeaucaire; 12-26-2019 at 04:54 PM.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Password lock for Worksheet in a excel workbook

    The page noted in post #2 provides all the code and a sample workbook ready for you to adapt into your project.

  5. #5
    Registered User
    Join Date
    07-26-2014
    Location
    Hong Kong
    MS-Off Ver
    Office 2010
    Posts
    24

    Re: Password lock for Worksheet in a excel workbook

    Im sorry im very armature with macro, I dun know how to merge the two code together. It unlock multiple sheets but it doesn't have user id can we add It to the script?

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Password lock for Worksheet in a excel workbook

    Well, then, whoever created this current password lock system for you has seriously overcoded it, all because you are using a userform. I think the biggest fail here is that you now have a workbook full of code I'm guessing you don't understand at all.

    There's no need for a form at all, as demonstrated in the much simpler example I showed.

    Truth is, there's no need to enter a "username" either. A password is all that is needed, the username can be implied. Take another serious look at the much simpler approach to the same end provided in my sample workbook.

    Here's yours back with the expansion for multiple sheets added, buried deep in the convolution.
    Attached Files Attached Files
    Last edited by JBeaucaire; 10-15-2014 at 11:20 AM. Reason: Sheet updated.

  7. #7
    Registered User
    Join Date
    07-26-2014
    Location
    Hong Kong
    MS-Off Ver
    Office 2010
    Posts
    24

    Re: Password lock for Worksheet in a excel workbook

    you are very correct, as the code is very complicated which I hardly understand any of it.

    The reason why I need to add user name is I assigned the user with password, so i figure if I combine user name plus password it would be harder for them to guess.

    When I downloaded the spreadsheet, and tried it with one of the user name and ID it doesnt open up the sheets rather it prompt with pop up box saying the login is correct

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Password lock for Worksheet in a excel workbook

    Which one did you try?

  9. #9
    Registered User
    Join Date
    07-26-2014
    Location
    Hong Kong
    MS-Off Ver
    Office 2010
    Posts
    24

    Re: Password lock for Worksheet in a excel workbook

    I tried Makei and Freark

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Password lock for Worksheet in a excel workbook

    the sheet in post #6 has been updated.

  11. #11
    Registered User
    Join Date
    07-26-2014
    Location
    Hong Kong
    MS-Off Ver
    Office 2010
    Posts
    24

    Re: Password lock for Worksheet in a excel workbook

    Thank you very much it worked perfectly
    how can I change my post to solved?

  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Password lock for Worksheet in a excel workbook

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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 lock and unlock worksheet using a password but inside worksheet change event
    By BeachRock in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-12-2014, 06:55 PM
  2. Replies: 1
    Last Post: 03-11-2013, 05:44 PM
  3. [SOLVED] Macro to lock the worksheet using an embedded password?
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2012, 01:50 PM
  4. Macro to lock worksheet without the user having to know the password.
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-26-2012, 01:53 PM
  5. Can I password Lock a sheet in a Workbook
    By ukphoenix in forum Excel Programming / VBA / Macros
    Replies: 36
    Last Post: 07-15-2008, 03:59 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