HI Friends,
I have below code to login with user id and pw in excel.
this work with only one user id, i have 5 user id and password which should take the user to different sheet with successfull login. eg: when login with user1, will take to sheet3 let the user do the update, when login with user2, should take sheet4 and so on
and also if the sheet is hidden, it is not going to concerned sheet.
it would be great any one can give a change in the below code.
Private Sub CommandButton1_Click()
Dim username, password As String
username = TextBox1.Text
password = TextBox2.Text
If username = "user1" And password = "11111" Then
MsgBox "logined successfully", vbInformation
Unload Me
Sheets("Sheet3").Select
Else
MsgBox "incorrect id and pw", vbCritical
ActiveWorkbook.Close
End If
End Sub
Thanks
Abdul Jaleel
I have below code to login with user id and pw in excel.
this work with only one user id, i have 5 user id and password which should take the user to different sheet with successfull login. eg: when login with user1, will take to sheet3 let the user do the update, when login with user2, should take sheet4 and so on
and also if the sheet is hidden, it is not going to concerned sheet.
it would be great any one can give a change in the below code.
Private Sub CommandButton1_Click()
Dim username, password As String
username = TextBox1.Text
password = TextBox2.Text
If username = "user1" And password = "11111" Then
MsgBox "logined successfully", vbInformation
Unload Me
Sheets("Sheet3").Select
Else
MsgBox "incorrect id and pw", vbCritical
ActiveWorkbook.Close
End If
End Sub
Thanks
Abdul Jaleel