Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
What I would like to do is have a password box appear prior to a macro
executing. In the example I'm citing I have a macro keying off a CommandButton but I don't want all users to be able to execute this macro, only those with the password. Is this possible. As always I am appreciative of your patience. -- Andy Tallent |
#2
![]() |
|||
|
|||
![]()
Sub password()
CC = InputBox("Please enter the password:") If CC = "password" Then 'PUT MACRO HERE MsgBox ("Macro Execution") End If End Sub "Andy Tallent" wrote in message ... What I would like to do is have a password box appear prior to a macro executing. In the example I'm citing I have a macro keying off a CommandButton but I don't want all users to be able to execute this macro, only those with the password. Is this possible. As always I am appreciative of your patience. -- Andy Tallent |
#3
![]() |
|||
|
|||
![]()
Thank you very much for this, it works perfectly.
Regards Andy Tallent "eluehmann" wrote: Sub password() CC = InputBox("Please enter the password:") If CC = "password" Then 'PUT MACRO HERE MsgBox ("Macro Execution") End If End Sub "Andy Tallent" wrote in message ... What I would like to do is have a password box appear prior to a macro executing. In the example I'm citing I have a macro keying off a CommandButton but I don't want all users to be able to execute this macro, only those with the password. Is this possible. As always I am appreciative of your patience. -- Andy Tallent |
#4
![]() |
|||
|
|||
![]()
One way:
At the beginning of your macro, put something like Const sPASSWORD As String = "drowssap" Dim vResponse As Variant Do vResponse = Application.InputBox("Enter the Password") If vResponse = False Then Exit Sub 'User Cancelled Loop Until vResponse = sPASSWORD In article , Andy Tallent wrote: What I would like to do is have a password box appear prior to a macro executing. In the example I'm citing I have a macro keying off a CommandButton but I don't want all users to be able to execute this macro, only those with the password. Is this possible. As always I am appreciative of your patience. |
#5
![]() |
|||
|
|||
![]()
Thank you, this works beautifully.
"JE McGimpsey" wrote: One way: At the beginning of your macro, put something like Const sPASSWORD As String = "drowssap" Dim vResponse As Variant Do vResponse = Application.InputBox("Enter the Password") If vResponse = False Then Exit Sub 'User Cancelled Loop Until vResponse = sPASSWORD In article , Andy Tallent wrote: What I would like to do is have a password box appear prior to a macro executing. In the example I'm citing I have a macro keying off a CommandButton but I don't want all users to be able to execute this macro, only those with the password. Is this possible. As always I am appreciative of your patience. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Date macro | Excel Discussion (Misc queries) | |||
Can't get simple macro to run | Excel Worksheet Functions | |||
Password cannot be removed | Excel Discussion (Misc queries) | |||
Macro and If Statement | Excel Discussion (Misc queries) | |||
Macro Formula revision? | Excel Worksheet Functions |