Keycode Constants in VBA

Download Keycode Constants in VBA

Post on 14-Oct-2014

512 views

Category:

Documents

8 download

TRANSCRIPT

Keycode ConstantsThe following constants can be used anywhere in your code in place of the actual values: Constant vbKeyLButton vbKeyRButton vbKeyCancel vbKeyMButton vbKeyBack vbKeyTab vbKeyClear vbKeyReturn vbKeyShift vbKeyControl vbKeyMenu vbKeyPause vbKeyCapital vbKeyEscape vbKeySpace vbKeyPageUp vbKeyEnd vbKeyHome vbKeyLeft vbKeyUp vbKeyRight vbKeyDown vbKeySelect vbKeyPrint vbKeyExecute Value 0x1 0x2 0x3 0x4 0x8 0x9 0xC 0xD 0x10 0x11 0x12 0x13 0x14 0x1B 0x20 0x21 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2A 0x2B Description Left mouse button Right mouse button CANCEL key Middle mouse button BACKSPACE key TAB key CLEAR key ENTER key SHIFT key CTRL key MENU key PAUSE key CAPS LOCK key ESC key SPACEBAR key PAGE UP key PAGE DOWN key END key HOME key LEFT ARROW key UP ARROW key RIGHT ARROW key DOWN ARROW key SELECT key PRINT SCREEN key EXECUTE key

vbKeyPageDown 0x22

vbKeySnapshot vbKeyInsert vbKeyDelete vbKeyHelp vbKeyNumlock

0x2C 0x2D 0x2E 0x2F 0x90

SNAPSHOT key INSERT key DELETE key HELP key NUM LOCK key

The A key through the Z key are the same as the ASCII equivalents A Z: Constant vbKeyA vbKeyB vbKeyC vbKeyD vbKeyE vbKeyF vbKeyG vbKeyH vbKeyI vbKeyJ vbKeyK vbKeyL vbKeyM vbKeyN vbKeyO vbKeyP vbKeyQ vbKeyR vbKeyS vbKeyT vbKeyU vbKeyV vbKeyW Value 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 A key B key C key D key E key F key G key H key I key J key K key L key M key N key O key P key Q key R key S key T key U key V key W key Description

vbKeyX vbKeyY vbKeyZ

88 89 90

X key Y key Z key

The 0 key through 9 key are the same as their ASCII equivalents 0 9: Constant vbKey0 vbKey1 vbKey2 vbKey3 vbKey4 vbKey5 vbKey6 vbKey7 vbKey8 vbKey9 48 49 50 51 52 53 54 55 56 57 Value Description 0 key 1 key 2 key 3 key 4 key 5 key 6 key 7 key 8 key 9 key

The following constants represent keys on the numeric keypad: Constant vbKeyNumpad0 vbKeyNumpad1 vbKeyNumpad2 vbKeyNumpad3 vbKeyNumpad4 vbKeyNumpad5 vbKeyNumpad6 vbKeyNumpad7 vbKeyNumpad8 vbKeyNumpad9 vbKeyMultiply 0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6A Value 0 key 1 key 2 key 3 key 4 key 5 key 6 key 7 key 8 key 9 key MULTIPLICATION SIGN (*) key Description

vbKeyAdd vbKeySeparator vbKeySubtract vbKeyDecimal vbKeyDivide

0x6B 0x6C 0x6D 0x6E 0x6F

PLUS SIGN (+) key ENTER key MINUS SIGN () key DECIMAL POINT (.) key DIVISION SIGN (/) key

The following constants represent function keys: Constant vbKeyF1 vbKeyF2 vbKeyF3 vbKeyF4 vbKeyF5 vbKeyF6 vbKeyF7 vbKeyF8 vbKeyF9 vbKeyF10 vbKeyF11 vbKeyF12 vbKeyF13 vbKeyF14 vbKeyF15 vbKeyF16 Value 0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7A 0x7B 0x7C 0x7D 0x7E 0x7F Description F1 key F2 key F3 key F4 key F5 key F6 key F7 key F8 key F9 key F10 key F11 key F12 key F13 key F14 key F15 key F16 key

Recommended

View more >