LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Password Protect Running of Macro

Of course you had better password protect your code as well.

Jon
"John" wrote in message
...
Thanks R.Bell, thats neat


"r.bell321" wrote in message
...

The original subroutine would have to read:
Sub PasswordForAMacro()
Userform1.Show
End Sub

You would need a userform (called Userform1) with a text box (called
Textbox1 with PasswordChar property set to "*") and a button (called
Button1) to submit the userform. Then put the following code in the
userform

Sub Button1_Click()
If Textbox1.text < "1234" Then
MsgBox "Invalid password - you cannot access this"
Userform1.Hide
Exit Sub
Else
'type the actions / code you require to run'
Userform1.Hide
End If


--
r.bell321Posted from - http://www.officehelp.in





 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to allow auto filter after running password protect Roady Excel Discussion (Misc queries) 1 July 17th 08 06:34 PM
Password for Running the Macro Naveen Excel Discussion (Misc queries) 3 July 13th 07 03:08 PM
Password Protect Macro? ryanmhess Excel Programming 4 January 27th 06 04:56 PM
Add protect worksheet password in macro Kelly Excel Worksheet Functions 1 January 10th 06 02:08 AM
Password protect macro Pete Excel Programming 2 April 16th 04 03:44 AM


All times are GMT +1. The time now is 01:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"