No announcement yet.

Login, Username, Password, Program

  • Filter
  • Time
  • Show
Clear All
new posts

  • Login, Username, Password, Program


    I'm just looking help for how to create a login form that when the right user enters their username and password it opens another userform. Currently I'm having difficulty starting but my username and passwords are all listed on one sheet, usernames are in column A and passwords in column B and the group they are part of in column E. Can anyone give me guidance as to how to start? I'm considered using a vlookup formula but am stuck on how to link it to the correct sheet etc. Thanks!

  • #2
    Can you attach a copy of your file? Explain in detail exactly what you want to do.
    You can say "THANK YOU" for help received by clicking "Like" in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.


    • #3

      So attached is some data, this was provided by my teacher for practice, all the user ID and passwords are fake but I need to create a login that allows all the users from the file to log in and I'm finding it hard to create a code that can match the password with ID. I'm tried matching it so that the username pulls up a row number and match the row number to the password but it seems to not work. Any suggestions? Thanks!
      Attached Files


      • #4

        you only make textbox1,cmb and combobox1
        Public dic As Object
        Private Sub UserForm_Initialize()
          Dim x, i
          x = Sheet1.[a1].CurrentRegion.Value
          Set dic = CreateObject("Scripting.dictionary")
          For i = 2 To UBound(x)
            dic(x(i, 1)) = x(i, 2)
          Next i
          With ComboBox1
            .List = dic.keys
          End With
          CommandButton1.Enabled = False
        End Sub
        Private Sub CommandButton1_Click()
         MsgBox "sucses to login ", vbCritical
        End Sub
        Private Sub TextBox1_Change()
        If ComboBox1.ListIndex = -1 Then Exit Sub
        If TextBox1.Value = dic(ComboBox1.Value) Then
          CommandButton1.Enabled = True
        End If
        End Sub