+ Reply to Thread
Results 1 to 4 of 4

VBA - Command Button, Userform, Username and Password

  1. #1
    Registered User
    Join Date
    12-16-2015
    Location
    GA
    MS-Off Ver
    2013
    Posts
    2

    VBA - Command Button, Userform, Username and Password

    Hello All,

    I am new to this whole forum thing as well as VBA.

    My question:

    I have created (with the help of tutorials and generous people sharing their code(s) and knowledge) a Userform for a Username and Password prompt to access the excel file. It uses Vlookup to look up usernames and password within a table inside the excel file.

    Code below:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I want that same Userform to pop up when a user clicks on a command button. They enter in their Username and Password;

    1.) If correct this MsgBox pops up:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    2.) If cancel on this new MsgBox, then end the script.

    3.) If incorrect on Username and Password, then they get to attempt their username and password again, until it is correct or until they hit cancel.

    Please, any help would be much appreciated, and if you have the time, could you explain the code and process. If not all is well.

    Thanks in advance!

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: VBA - Command Button, Userform, Username and Password

    tramonroe,
    Can you attach a sample workbook with your code and a bogus username and password? That way I/we can see how everything works and then write and test code for you
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    12-16-2015
    Location
    GA
    MS-Off Ver
    2013
    Posts
    2

    Re: VBA - Command Button, Userform, Username and Password

    Hello gmr4evr1,

    Here is the file you have asked for. The Username and Password gives you the debug message once the file is opened. I don't know what that is all about.

    Thank you.
    Attached Files Attached Files

  4. #4
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    503

    Re: VBA - Command Button, Userform, Username and Password

    try


    Please Login or Register  to view this content.

+ 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. Replies: 2
    Last Post: 02-02-2016, 10:27 PM
  2. [SOLVED] Run Command Prompt Icacls code in VBA Command Button on Userform
    By luismalave in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2015, 11:40 PM
  3. Posting time stamp and username using command button
    By mcav16 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-23-2014, 04:08 PM
  4. Username/Password Login userform code
    By Nitefox in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2014, 02:43 PM
  5. [SOLVED] Username and Password Form - Show Username in Sheet
    By ryan180 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2013, 07:06 PM
  6. Macro Running Userform for Username/Password
    By Escobarjr in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-03-2013, 12:08 PM
  7. [SOLVED] COmmand button requiring password, if password ok, unhide sheet.
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-04-2012, 09:43 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