+ Reply to Thread
Results 1 to 16 of 16

Drop down list protected by individual passwords (VBA)

  1. #1
    Registered User
    Join Date
    04-07-2016
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    35

    Drop down list protected by individual passwords (VBA)

    Hi everyone,

    I have been scratching my head for a few hours now and I cannot figure this out on my own.

    I want to create a drop down list, with 4 slots, first blank, and the 3 others are names, let's say Bob X, Lee Y and Steve T.

    This is for manager approval. What I want is that no one can mess with this drop down list, except for those 3 Managers.

    i.e. Bob want to click his name, he needs to input his specific password, if wrong, he will get a message "Wrong Password". If good, his name will be showing, proof of his approval. But his password won't work if he clicks Steve for example.

    Thanks to anyone that can help me on this one.

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Drop down list protected by individual passwords (VBA)

    What kind of "drop down list" are you using for this? Is it "in cell data validation" or one of the combobox controls? Is it on a userform or on a sheet?

    Any chance of a small sample workbook so a solution can be tailor made?

    BSB

  3. #3
    Registered User
    Join Date
    04-07-2016
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    35

    Re: Drop down list protected by individual passwords (VBA)

    Yes, it's in cell data validation.

    I am getting pretty close, it works, but it always show "Wrong Password"

    Here is what I got so far
    Please Login or Register  to view this content.
    Last edited by 6StringJazzer; 04-08-2016 at 01:47 PM. Reason: code tags

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Drop down list protected by individual passwords (VBA)

    Whilst we look into this for you, could you edit your post so there are code tags around your code? Forum rules and all that.

    BSB

  5. #5
    Registered User
    Join Date
    04-07-2016
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    35

    Re: Drop down list protected by individual passwords (VBA)

    Forgot to answer a question, it's on a sheet, once done, I will password protect most of it, leaving some cells free, to input data

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Drop down list protected by individual passwords (VBA)

    Moderator's note: sylvainsyl20, please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Drop down list protected by individual passwords (VBA)

    This code won't compile. To use the strings you declared at the top, remove the "1" in the following lines. Then you will be correctly using the declared variables.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    04-07-2016
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    35

    Re: Drop down list protected by individual passwords (VBA)

    Thanks, I didn't know about this

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Drop down list protected by individual passwords (VBA)

    One other thing. Excel is not a good tool to enforce security. If someone wants to bypass this, all they have to do is not allow macros to run.

  10. #10
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Drop down list protected by individual passwords (VBA)

    Quote Originally Posted by 6StringJazzer View Post
    This code won't compile. To use the strings you declared at the top, remove the "1" in the following lines. Then you will be correctly using the declared variables.

    Beat me to it!

    BSB

  11. #11
    Registered User
    Join Date
    04-07-2016
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    35

    Re: Drop down list protected by individual passwords (VBA)

    Thanks, I gave it a try and still the same, choosing any name, applying password, i.e. password Bob1 when choosing Bob, always get "Wrong Password"

  12. #12
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Drop down list protected by individual passwords (VBA)

    Works fine for me.
    Don't forget that the password will be case sensitive.

    BSB
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    04-07-2016
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    35

    Re: Drop down list protected by individual passwords (VBA)

    Works perfectly, Thanks a lot

    Still have a question on this one, if I want to use complete names in the list, i.e. Bob Cooper, what modification will I have to make in the VBA?

    Thanks again, very helpful

  14. #14
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Drop down list protected by individual passwords (VBA)

    Alter the data validation list and then amend the case lines of code to match:
    Please Login or Register  to view this content.
    BSB

  15. #15
    Registered User
    Join Date
    04-07-2016
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    35

    Re: Drop down list protected by individual passwords (VBA)

    Fantastic, You solved this one within minutes, I spent hours trying to figure it out.

    Thanks and have a great day

  16. #16
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Drop down list protected by individual passwords (VBA)

    Only easy when you know how!

    Jeff gets the credit though as he got in with the answer first

    BSB

+ 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. Individual formulas for each drop down list entry.
    By clogistics in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-03-2016, 12:56 AM
  2. Replies: 3
    Last Post: 12-22-2014, 09:14 PM
  3. [SOLVED] Open password protected files in folder using list of passwords
    By Shift-4 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-22-2013, 06:08 PM
  4. Export Drop Down List Data to Individual Worksheets
    By adamsjk31 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-11-2012, 04:38 PM
  5. Individual Passwords per sheet
    By Djarn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-19-2012, 09:52 AM
  6. Individual tab passwords
    By Socrates in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 10-25-2009, 11:25 PM
  7. Copy data to an individual file based on drop down list
    By xlnewbe in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-05-2007, 01:52 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