ต้องการโค้ด login แบบมีหลาย ยูสเซอร์ ช่วยแก้ไขให้หน่อยค่ะ
Posted: Fri Aug 07, 2020 2:53 pm
Dim strUsername As String
Dim strpassword As String
Dim Use As Variant
Dim pwd As Variant
strUsername = Username.Text
strUsername = password.Text
Use = Application.VLookup(Username.Text, Rang("users"), 2, False)
pwd = Application.VLookup(password.Text, Rang("pass"), 2, False)
If IsError(Use) = False Then
If Application.VLookup(Username.Text, Rang("users"), 2, 0) = _
password.Text Then
Sheets("Input").Select
MsgBox "Login"
Unload Login
Else
MsgBox "pass"
End If
End If
Dim strpassword As String
Dim Use As Variant
Dim pwd As Variant
strUsername = Username.Text
strUsername = password.Text
Use = Application.VLookup(Username.Text, Rang("users"), 2, False)
pwd = Application.VLookup(password.Text, Rang("pass"), 2, False)
If IsError(Use) = False Then
If Application.VLookup(Username.Text, Rang("users"), 2, 0) = _
password.Text Then
Sheets("Input").Select
MsgBox "Login"
Unload Login
Else
MsgBox "pass"
End If
End If