View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Password To Run Macro?

What do you mean by "lock down" the macros?

This addition will prevent a macro from running if pword is incorrect but
you must lock the project from viewing if you don't want the users to see
the password by snooping at the VBE

Dim pword As String
pword = InputBox("enter password")
If pword < "justme" Then
Exit Sub
Else
do your stuff
End If


Gord Dibben MS Excel MVP

On Mon, 16 Mar 2009 10:33:07 -0700, garyh
wrote:

Is there a way to request a password when a macro button is clicked? I
would like to 'lock' down the macros.

Thanks.

G