View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Buttons in excel 2003

Sorry you wanted a button on the sheet. Put a button on the sheet, right
click it - view code and paste the code below in.

Private Sub CommandButton1_Click()
Dim Response As String
Dim MyPass As String
MyPass = "xxx"
Response = InputBox("Enter your password")
If Response < MyPass Then
MsgBox "Not Authorised"
Exit Sub
End If
Call YourSubName
End Sub

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Neil Holden" wrote:

Hi all, I have a button and when pressed would like to say 'Please enter your
password, once the password has been validated the rest of the macro will run.

Is this possible?