https://www.contextures.com/excelvbasendkeys.html
Note: CASE SENSITIVE!
Application.Wait (Now() + TimeValue("00:00:03")) SendKeys "{RIGHT}{RIGHT}{ENTER}{TAB}{TAB}{TAB}{TAB}{ENTER}" SendKeys "%{f4}", TRUE ' Alt + F4 SendKeys "^{v}", TRUE ' Paste SendKeys "%{n}", TRUE ' Focus IE Nav bar
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} |
To combine keys with Ctrl, Shift and/or Alt, precede the character with the following codes. For example:
SendKeys "+{F2}" ...for Shift + F2
Key | Code |
SHIFT | + (plus sign) |
CTRL | ^ (caret) |
ALT | % (percent sign) |