View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
papou[_4_] papou[_4_] is offline
external usenet poster
 
Posts: 110
Default Trap a user to a cell.

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

"Gordon" a écrit dans le message de news:
...
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