View Single Post
  #2   Report Post  
Paul B
 
Posts: n/a
Default

Nick, something like this, you will need lock the VBA project so you can't
see the password in it


Sub PassWord_To_Run()
'must lock VBA project so you can't see the password in it
Dim MyStr1 As String, MyStr2 As String
MyStr2 = ("123") 'This is the password and it is CASE sensitive
MyStr1 = InputBox("Password Required")
If MyStr1 = MyStr2 Then

'your code here

Else
MsgBox ("Access Denied")
End If
End Sub



--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Nick" wrote in message
...
I am trying to write some code so when a button is pressed a password

message
comes up and needs to be entered for accessing the information.

Any ideas people. Would be very grateful as been trying this for a while

now