Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub MLIB_Click()
- Dim UserName As String
- Dim PassWord As String
- ' MUN is the name of the textbox associated to the Username
- ' MPW is the name of the textbox associated to the Password
- UserName = MUN.Value
- PassWord = MPW.Value
- If UserName = Application.WorksheetFunction.VLookup(UserName, Sheets("User_List").Range("B3:C1000"), 1, True) Then
- If PassWord = Application.WorksheetFunction.VLookup(PassWord, Sheets("User_List").Range("B3:C1000"), 2, True) Then
- Sheets("Home_Page").Activate
- Unload Me
- End If
- End If
- MsgBox "Sorry, Incorrect Login Details"
- End Sub
- With Worksheets("User_List")
- If Not IsError(Application.Match(UserName, .Column(2), 0)) Then
- If Password = Application.VLookup(UserName, .Range("B:C"), 2, False) Then
- Worksheets("Home_Page").Activate
- Unload Me
- End If
- End If
- End With
- MsgBox "Sorry, Incorrect Login Details"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement