Trap a user to a cell.

  • Thread starter Thread starter Gordon
  • Start date Start date
G

Gordon

Hi.

I have a file that I need users to enter a password before they can use it.
Ideally, when the file opens a message box fires telling them to enter a
password into cell A2. The passwords work on hidden vlookup tables which
means that I can't password protect the file conventionally. Anyway, is there
any code that will trap the user to a1, disable the mouse/pointer and
direction buttons until a the value of the password has been met. Although
there are many passwords they all will trigger a 1 if the found within the
vlookup table. So therefore, if A1 = 1 then the file is released and normal
controls apply.

Hope this isn't too fiddly!

Thanks

G
 
Hello Gordon
You could set the ScrollArea property of the worksheet to one cell (A1 in
your case)
Worksheets(Sheet1").ScrollArea = "A1"
Then use the Worksheet_Change event to check for the password input.
And finally, when done with the password checking, set the scrollarea back
to normal with:
Worksheets(Sheet1").ScrollArea = ""


HTH
Cordially
Pascal
 

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

Back
Top