Password protect a macro (1 Viewer)

jason2885

Registered User.
Local time
Today, 13:06
Joined
Jun 18, 2007
Messages
99
I have a button in a form that runs a macro. I need to somehow password protect that button. How could I go about doing that.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 13:06
Joined
Aug 30, 2003
Messages
36,140
One way:

Code:
If InputBox(...) = "password" Then
  'run macro
Else
  Msgbox "Wrong password"
End If

See VBA Help for more info on InputBox if needed.
 

Users who are viewing this thread

Top Bottom