Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Andy Tallent
 
Posts: n/a
Default Password required before Macro execution

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   Report Post  
eluehmann
 
Posts: n/a
Default

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   Report Post  
Andy Tallent
 
Posts: n/a
Default

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   Report Post  
JE McGimpsey
 
Posts: n/a
Default

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   Report Post  
Andy Tallent
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Can't get simple macro to run Abi Excel Worksheet Functions 5 January 12th 05 07:37 PM
Password cannot be removed twa14 Excel Discussion (Misc queries) 3 December 14th 04 11:27 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM
Macro Formula revision? Mark Excel Worksheet Functions 1 November 28th 04 01:43 AM


All times are GMT +1. The time now is 07:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"