Hi everyone, I actually need help. I am doing a college work and I managed to do user form login and inserted a code on "this Workbook" to all the worksheets except the login worksheet and everything is working fine but I want to unhide the rest of the worksheet when I login.
Those are the codes I used, so please help me if you guys can
This one for the userform
Private Sub cmdcheck_Click()
Dim username, password As String
username = txtUser.Text
password = txtpass.Text
If txtUser.Value = "aj" And txtpass.Value = "45423240" Then
MsgBox "WELCOME TO MY ASSIGNMENT TASK 2:).To unhide the worksheet click ADMIN ICON", vbInformation
Unload Me 'unload this form
Else
MsgBox "You Entered the wrong information,Please enter lower case only.", vbCritical
End If
End Sub
This for the "THIS WORKBOOK"
Private Sub Workbook_Open()
Dim ws As Worksheet
For Each ws In Worksheets
If ws.Name <> "MAINLOGIN" Then
ws.Visible = xlSheetHidden
End If
Next ws
PopUp.Show
End Sub
I would really apricate if any one can share his thoughts