So i have a lot of password protected macro buttons in my project and I am tracking the user name of anyone who enters the correct password on a hidden sheet called "users" its kind of a built in audit trail . I would also like to capture the user names of people who enter a bad password...
Here is my code for the password :
Here is the code I would like to insert :
Thanks in advance for any and all help
Here is my code for the password :
Code:
Sub unhideall()
Dim x
x = InputBoxDK("Type your password here.", "Password Required")
If x = "" Then End
If x <> "superuser" Then
MsgBox "You didn't enter a correct password."
End
End If
Here is the code I would like to insert :
Code:
With Worksheets("users")
Set ws = Sheets("users")
LastRow = ws.Range("J" & Rows.Count).End(xlUp).Row + 1
ws.Range("J" & LastRow).Value = Environ$("UserName")
ws.Range("K" & LastRow).Value = Format(Date + Time, "dd mmm yyyy hh:mm:ss")
ws.Range("L" & LastRow).Value = Format("bad password")
End
Thanks in advance for any and all help