Syntax
expression .SendKeys(Keys, Wait)
expression A variable that represents an Application object.
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Keys | Required | Variant | The key or key combination you want to send to the application, as text. |
Wait | Optional | Variant | True to have Microsoft Excel wait for the keys to be processed before returning control to the macro. False (or omitted) to continue running the macro without waiting for the keys to be processed. |
Key
|
Code
|
BACKSPACE
|
{BACKSPACE} or {BS}
|
BREAK
|
{BREAK}
|
CAPS LOCK
|
{CAPSLOCK}
|
CLEAR
|
{CLEAR}
|
DELETE or DEL
|
{DELETE} or {DEL}
|
DOWN ARROW
|
{DOWN}
|
END
|
{END}
|
ENTER (numeric keypad)
|
{ENTER}
|
ENTER
|
~ (tilde)
|
ESC
|
{ESCAPE} or {ESC}
|
HELP
|
{HELP}
|
HOME
|
{HOME}
|
INS
|
{INSERT}
|
LEFT ARROW
|
{LEFT}
|
NUM LOCK
|
{NUMLOCK}
|
PAGE DOWN
|
{PGDN}
|
PAGE UP
|
{PGUP}
|
RETURN
|
{RETURN}
|
RIGHT ARROW
|
{RIGHT}
|
SCROLL LOCK
|
{SCROLLLOCK}
|
TAB
|
{TAB}
|
UP ARROW
|
{UP}
|
F1 through F15
|
{F1} through {F15}
|
You can also specify
keys combined with SHIFT and/or CTRL and/or ALT. To specify a key combined with
another key or keys, use the following table.
To combine a key with
|
Precede the key code
with
|
SHIFT
|
+ (plus sign)
|
CTRL
|
^ (caret)
|
ALT
|
% (percent sign)
|
Here is an example to use SendKeys
-------------------------------------------------------------------------------------------------------------------------
Sub Test()
Application.SendKeys "{HOME}", True 'send HOME to the Excel and wait for the keys to be processed
Application.SendKeys "Test" 'send word "Test" to the Excel with default value (without true/false) and not wait for the keys to be processed
End Sub
-------------------------------------------------------------------------------------------------------------------------
Big shots are only little shots who keep shooting.
ReplyDelete\See the link below for more info.
#shots
www.ufgop.org
Gioco Digale - Latest News, Videos & Games
ReplyDeleteGioco jeetwin Digale is a gioco digitale video slot machine made by Nolimit City Limited. The game is designed for the use of bet365 the internet's most advanced gaming