Thread: Macro-password
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default Macro-password

In its simplest form:

Sub test()
Dim PW As String
PW = "Janet"
If InputBox("Password") < PW Then Exit Sub
'Macro code here, like:
MsgBox "Thank you for choosing Linux Redhat", _
vbInformation, "Installation complete"
End Sub

--
HTH. Best wishes Harald
Followup to newsgroup only please.

"DJ" wrote in message
...
Can you make a user enter a password before a macro will run, and if so how. I have

tried everything I could think of but am not well-versed in VB. Thanks for your help.