mabasitsalim
New Member
- Joined
- Jan 1, 2021
- Messages
- 1
- Office Version
- 2016
- Platform
- Windows
i have created a calculation sheet, which calculates some sort of data, since its a multiuser sheet, i have created a number of user accounts by creating a userform using this bellow Code Number 1, what i am looking is to create a simple log record, which shall record on User Name, Login Date & Time and Logout Data & Time in a specified "Log" sheet.
CODE NUMBER 1
Private Sub CommandButton2_Click()
Seets("Admin").Range("A2") Then
If TextBox2.Text = Sheets("Admin").Range("B2") Then
MsgBox "Welcome Admin"
Application.Visible = True
ActiveWorkbook.Unprotect ("XXXXX")
Sheets("Admin").Visible = True
Sheets("Data").Visible = True
Sheets("Report").Visible = True
Sheets("Log".Visible=True
ActiveWorkbook.Protect Password:="XXXXX"
Unload Me
Else
MsgBox "Wrong User ID or Password"
End If
End If
CODE NUMBER 1
Private Sub CommandButton2_Click()
Seets("Admin").Range("A2") Then
If TextBox2.Text = Sheets("Admin").Range("B2") Then
MsgBox "Welcome Admin"
Application.Visible = True
ActiveWorkbook.Unprotect ("XXXXX")
Sheets("Admin").Visible = True
Sheets("Data").Visible = True
Sheets("Report").Visible = True
Sheets("Log".Visible=True
ActiveWorkbook.Protect Password:="XXXXX"
Unload Me
Else
MsgBox "Wrong User ID or Password"
End If
End If