Here's what supposed to happen:
From a button in worksheet with code in the worksheet, I call a user form "Password"
I input a password which it saves as "PWord" and it checks to see if it's good (in user form code) and unlocks the sheet if it is.
Then hides the form
The code in worksheet then does some stuff and locks the sheet using PWord
However, seems PWord has become "" and I'm left with an unprotected worksheet.
I've tried putting
"Dim PWord as string" outside the Form code, outside the worksheet code but doesn't seem to matter.
Any thoughts on what I'm doing wrong?
Bookmarks