ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Trap a user to a cell. (https://www.excelbanter.com/excel-programming/417862-trap-user-cell.html)

Gordon[_2_]

Trap a user to a cell.
 
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

papou[_4_]

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





All times are GMT +1. The time now is 05:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com