+ Reply to Thread
Results 1 to 4 of 4

How to allow multiple entries from a Password InputBox

  1. #1
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    How to allow multiple entries from a Password InputBox

    This works:

    Please Login or Register  to view this content.
    How can I add a second option so that if they enter the ADMIN password or the GENERAL USER password it accepts either one?

    ADMIN_Password is the Named Range of the ADMIN Password
    User_Password is the Named Range of the General User Password

    I tried to add an OR but it didn't work:
    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    The code that you claims works does nor work for me . I have Excel 2003


    But as you claim it works for you I will correct your code. Note I can not test this modifcation

    In your code you should use And instead of Or
    You was also missing PSWRD <> when checkin the User_Password range

    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686
    Thanks this works. At first I didn't think the AND operator was correct but now I see that it means If the password is not =ADMIN and the password is not =USER then fail.
    & it works with or without .Value

    Please Login or Register  to view this content.
    Thanks a bunch.

    PS. I'm using Excel 2000, I hope I don't have any trouble when we upgrade.
    BTW, my ADMIN_Password Range is only one cell

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Having the range as a single cell explains why yours worked & mine did not.

    If you expand the named range to more than 1 cell you will find that it will cause an error in the code.

    If you do need to expand the ranges then your code will need to be modified to search each cell of the range

+ 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