Password Protect a single sheet using VBA

G

Guest

Hello All,
Question:
How can i programmatically password protect a single password.

I want the user to be presented with an input box where they are asked to
enter a password. If the password entered is correct, then go to Sheet 1,
else display a message saying 'Incorrect Password' and return the user to the
Main Menu, preventing the user from accessing Sheet 1.

Suggestions?
 
J

JE McGimpsey

It is somewhat difficult to implement this, and if you truly want to
*prevent* an unauthorized user from accessing the worksheet, it's
ultimately futile. XL's internal protection is so tissue thin that
anyone with the ability to access these newsgroups can find free and
quick methods to bypass it.

You can find many suggestions in the archives - the most useful will use
event macros to hide all sheets but the Main Menu in the Before_Save
event, and call a routine/userform to input a password in the
Workbook_Open event, unhiding the sheet if the password is valid.

But again, most implementations can be bypassed in 30 seconds or so...

You're a bit better off if you use a separate workbook for your Sheet 1,
with a workbook/file password - that protection takes perhaps a minute
to bypass.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top