View Single Post
  #2   Report Post  
P Sitaram
 
Posts: n/a
Default

Try:

Const sPASSWORD As String = "****"
Dim vResponse As Variant
Dim i as Integer
Do
vResponse = Application.InputBox("Please enter the password")
If vResponse = False Then Exit Sub 'User Cancelled
If vResponse < sPASSWORD Then
MsgBox "Unfortunately this is not the
correct password"
Else
Exit Loop
EndIf
i = i+1
Loop Until i < 3