Public Const AdminPassword As String = "AdminPass"
Public Sub DemoPassword()
Const LocalPassword = "LocalPass"
pswd = Application.InputBox("Enter Password", "Password")
If pswd <> LocalPassword And pswd <> AdminPassword Then Exit Sub
MsgBox "you're in"
End Sub
ANOTHER SOL'N
This solution does not require a password ... what it does is check who is logged into the computer and admits you to the macro based on comparing the login name to the list of people allowed into macro. In my system I take that a step further and have the macro go out to a central spreadsheet that checks for login name to Macro relationship... this allows for central admin of all macro access. Or ... you can have the name listed in each macro .. as it is in this example
Public Sub DemoLoginName()
Const WinLogin As String = "nimrod,tellis,fredk"
If InStr(1, WinLogin, Environ("username")) = 0 Then Exit Sub
MsgBox "you're in"
End Sub
Bookmarks