English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How do I do things like this:

If PGDN-key-is pressed then .......

If PGUP-key-is pressed then .......

If LEFT-key-is pressed then .......

If RIGHT-key-is pressed then .......

If UP-key-is pressed then .......

If DOWN-key-is pressed then .......


Thanks a lot!

2007-01-24 13:32:52 · 3 answers · asked by wonder 3 in Computers & Internet Programming & Design

3 answers

Place a textbox onto the sheet. You can use the keypress event to get the KeyAscii of text entered into the box.

If you aren't using a text box you will have to use the worksheet selection_change and change events and validate the text entered in the cell

I don't believe there is a worksheet equivalent of a form level keypress event as in regular VB.

2007-01-24 17:47:02 · answer #1 · answered by MarkG 7 · 1 0

You can't
The VBA in Excel is not the same as plain VB.
You can do what the other answerer is saying
OR
Show a UserForm and watch the keys pressed while that form is loaded in modal

Otherwise there is no way
Why you need such a thing in Excel any way?

mail me here if you need more info

Enjoy my profile, I am the VBAXLMan

2007-01-25 01:29:27 · answer #2 · answered by Anonymous · 0 1

In layout mode on your style you could examine the tab end of your telephone extensive style field and notice the subsequent tab end for the style. With this merchandise you could then use an onactivate code on that merchandise to validate the telephone extensive style field and if it fails make the telephone extensive style administration the lively administration returned.

2016-11-27 00:15:50 · answer #3 · answered by ? 4 · 0 0

fedest.com, questions and answers