Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Macro protection

I have a program set up in excel it has a main screen with
a bunch of buttons that will take you to different area of
the workbook, what I need is to put a password or
something on the one button so that only those people who
need access to that part of the book can get into it.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Macro protection

Michelle, here is one way to require a password to run a macro

Sub Password_Request()
'you must lock the VBA project so you can't see the password in it
Dim PW As String
PW = Application.InputBox( _
Prompt:="Please Enter The Password", _
Title:="Password Required To Run This Macro", _
Type:=2)
If PW = "a123" Then 'Change password here, it is CASE sensitive

'*****Put Your Code Here*****
MsgBox "That's it !"


Else
'****If password does not match*********
MsgBox Prompt:="Sorry, That Is Not The Correct Password", _
Title:="Incorrect Password", _
Buttons:=vbOKOnly

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 2000 & 2003
** remove news from my email address to reply by email **

"Michelle" wrote in message
...
I have a program set up in excel it has a main screen with
a bunch of buttons that will take you to different area of
the workbook, what I need is to put a password or
something on the one button so that only those people who
need access to that part of the book can get into it.



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
Excel Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 06:50 AM
Protection Macro Lois Excel Worksheet Functions 2 May 11th 09 04:45 PM
Protection Macro Spheon Excel Discussion (Misc queries) 5 July 29th 06 01:16 PM
Protection + Macro = NOTHING! GOAT2G Excel Programming 0 May 4th 04 06:09 PM
protection macro Labrat Excel Programming 5 March 4th 04 05:56 PM


All times are GMT +1. The time now is 02:23 AM.

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

About Us

"It's about Microsoft Excel"