If you are not using a password to protect the sheet, you can remove that part of the code. The obvious drawback is that this code puts the password "out there". So, if you are concerned about security, you would need to lock the VB project itself with a password to keep knowledgeable folks from hacking it.
A (only slightly) less vulnerable method would be to use a "hidden" Name to contain the password. (You could remove the code after using it one time.)
Then, use this version of the code:
A person would have to be pretty knowledgable about VBA to get at your password using this. But, on the downside, this method acutally makes your password [B][I]less[B][I] secure than the above method (if the above is combined with locking the VBProject).
Bookmarks