MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

How to test what key was pressed?

  Asked By: Keira    Date: Sep 05    Category: MS Office    Views: 1629

In Excel vba, how do I test what key a user just pressed? In VBA,
how do I examine what key users just pressed?How do I do the following code of
if portion?

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 ......



1 Answer Found

Answer #1    Answered By: Adelfrid Fischer     Answered On: Sep 05

type in [test user key  press] without the [], and browse through the
results. That should get you started.

The best early result is
0853f05e7f - you should now search for &H11 and other key definitions.
Using Google web search for [&H11 VBA] I found this:

For your code  portion, see the second web reference as well.

Didn't find what you were looking for? Find more on How to test what key was pressed? Or get search suggestion and latest updates.