View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Gary Brown[_4_] Gary Brown[_4_] is offline
external usenet poster
 
Posts: 209
Default Password on Macro Button

A VERY simple password [password = HELLO] that is VERY unprotected would be...
'/========================================/
Sub MyMacroButton()
If SimplePassword(InputBox("Enter Password: ")) Then
'put code here
Else
Exit Sub
End If
End Sub
'/========================================/
Private Function SimplePassword(strAnswer As String) As Boolean
If UCase(strAnswer) = "HELLO" Then
SimplePassword = True
End If
End Function
'/========================================/
--
Hope this helps.
Thanks in advance for your feedback.
Gary Brown


"scuba" wrote:

Is it possible to have a macro assigned to a macro button that when the
button is selected it will ask for a password before the macro will run?