Password Protecting a command button
hi A
you could try using a inputbox something like below should give you an
idea of what to do
Option Explicit
Dim mypassword As String
Private Sub CommandButton1_Click()
mypassword = Application.InputBox("Please Enter Password",
"Restricted")
If mypassword = "test" Then 'set your password here
MsgBox ("run your code here") ' add your own code to delete sheets
here
Else
mypassword = Application.InputBox("Incorrect Password try again",
"Restricted") 'try again
End If
End Sub
hope this is of some use for you
S
|