+ Reply to Thread
Results 1 to 3 of 3

Validation of Username and Password

  1. #1
    Registered User
    Join Date
    05-08-2013
    Location
    Souderton, pa usa
    MS-Off Ver
    Excel 2010
    Posts
    1

    Validation of Username and Password

    Hello Everyone

    I am very very new to excel, Lots of experience using Microsoft Tsql and Crystal Reports.
    I need to force the user to enter their username and password before they are allowed to enter any data.
    I have multiple sheets in the workbook, Sheet A has the valid usernames in column a and valid passwords in column b.
    In Sheet B for cell L41 I have created a drop down list of usernames from Sheet column a. The user picks their username
    and then is forced to enter their password into cell M41. At this point I need to validate the password that was entered into
    sheet B cell M41 against the valid combination of (username and password) from Sheet A columns a ans b. I really do not want
    to populate any cells with the data from Sheet A, only make sure that the combination of username and password are valid so I
    can unlock cell ranges in the sheet. How can I accomplish this task?

    Any help will be greatly appreciated
    Thanks
    JLW SR

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Validation of Username and Password

    Security Workbook.xlsm

    The above is a template workbook with a password system like the one you are looking for...
    It won't defeat serious hackers but is good enough for casual users.

    The password for each user is their first name (case sensitive) and they have the facility to change it
    Elegant Simplicity............. Not Always

  3. #3
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Validation of Username and Password

    I think its possible using vlookup function where for each username you get a unique password.
    So for example, in sheet A, where you have all usernames and passwords, 'till here this is ok. Then in cell L41 from sheet B you created a drop-down list from usernames of sheet A. Now you have to use VLOOKUP function more or less like this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This formula here will make the matched password of the selected username appear in the cell where you put this formula.
    So lets say you put this formula on cell MJ1000. Now when the user selects the username you will get the password in cell MJ1000. I put it here because is hidden from sight, and offcourse you can put it on other sheet, change color, hide collumn, as you wish, as long it stays hidden.

    Now user as to enter the password on cell M41.
    Here you will use the password get on cell MJ1000 to compare with the one entered from the user.
    So... in the next cell N41 you can add the next formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And now is where the VBA comes in....
    First you have to protect all sheets that you want to have locked from user 'till validation of the username.
    Then add a button "LOGIN" and macro to unlock all sheets based on the result you get from N41 cell.

    If TRUE, the macro will execute (after the user pressed the LOGIN button) and unlocks the correspondent sheets.
    If FALSE, the macro would display a msg box sayng: "Invalid Username or Password. Please try again".

    Unfortunately VBA in my weakest link.... but with this aproach i think all super users from this forum will be able to help you...

    Hope i did help some way.
    Good luck

+ 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