Tell the message short and sweet.

Read This!

How to write Macro for Login Form with VLookup in Excel? (VBA-Macro Code included)

User ID and Password login form is written in VBA-Excel.

Requirements are listed below. Based on the requirement, code is written in Excel-Macro. You can download and modify the excel sheet according to your requirements.
  1. User ID text field should contain only 6 numeric letters. (For Example, like a Office employee ID).
  2. User ID and Password field should not be empty.
  3. Password should match the respective user id in the UserPassword sheet.
  4. Cancel Button only should be used for cancellation the form.
  5. If the form is cancelled, entire excel sheet should be closed.
  6. Update password button should accept the new password.
  7. Reset button should clear all the fields in the login form.
  8. Logged in User ID should be displayed in the Cell no.D9 in the Login_ID Sheet. For Example:- If your logging with the user id(123456), respective name should be displayed
  9. in the Cell D9.

Default User ID and password for Login Form.

User ID Password
123456 password

Download the Login Form Excel Sheet

You can provide your feedback and post your comments in the below comments form.


  1. Hi! I downloaded the excel login form but am unable to edit it due to the sheets being protected.

  2. I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have enjoyed reading. Nice blog, I will keep visiting this blog very often.
    excel vba courses london

  3. Hi, please can you tell me how to expand the users?
    When i try this the new user profile login works but, when trying to use the password change feature it breaks.

  4. i reviewed the update code and believe that nicks error is because of the parameters set on the update button code line:

    myvalue = Application.WorksheetFunction.Match(Val(struser), Range("A1:A10"), 0)

    range ("a1:a10") is your culprit
    i believe that it would be more dynamic if set that range to an arrey and use redim preserve or alternatively set the range to a variable that catches the whole range on request including any additions.

  5. Hello! It looks like the writer of this blog is really very professional because I never read such kind of writing before. The way of writing and the way of using right words on right place shows some expert skills.
    bioresonantie enschede

  6. This blog is really helpful regarding all educational knowledge I earned. It covered a great area of subject which can assist a lot of needy people. Everything mentioned here is clear and very useful.bioresonantie enschede

  7. Get huge discount on Home and Kitchen Appliances,Split and Window Air Conditioner, Mobiles & Laptops online , Television, Speakers & more electronics at best price.
    samsung washing machine

  8. You sound so passionate about what you are writing. Keep up the good work CBD Oil India