Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default password on macros

How can I put a password on a macro button?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default password on macros

Just, some thing like this

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

'your code here

Else
MsgBox ("Access Denied")
End If
End With
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 2000 & 2003
** remove news from my email address to reply by email **
"justaguyfromky" wrote in message
...
How can I put a password on a macro button?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default password on macros

In the macro itself, write the code to prompt for the password and to
validate and react to the response.

--
Regards,
Tom Ogilvy


"justaguyfromky" wrote in message
...
How can I put a password on a macro button?



Reply
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
Run Macros in a Password-protected workbook? JRSCEI Excel Discussion (Misc queries) 1 January 9th 10 10:27 PM
Password protect macros in Excel Greg Sottile Excel Discussion (Misc queries) 5 December 15th 09 01:23 PM
Password protect a sheet without Macros Cappa Excel Discussion (Misc queries) 3 May 27th 06 01:49 AM
password protecting macros Saju S Excel Programming 1 September 29th 04 07:24 AM
Password set/clear macros - help! Ken Bosward Excel Programming 0 November 4th 03 10:55 PM


All times are GMT +1. The time now is 02:29 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"