Key Code: (Backspace) (BS) (Break) (Capslock) (Clear)
Key Code: (Backspace) (BS) (Break) (Capslock) (Clear)
Key Code: (Backspace) (BS) (Break) (Capslock) (Clear)
BACKSPACE {BACKSPACE} or {BS}
BREAK {BREAK}
CLEAR {CLEAR}
END {END}
ENTER ~ (tilde)
ESC { ESCAPE} or {ESC}
HELP {HELP}
HOME {HOME}
INS {INSERT}
PAGE UP {PGUP}
RETURN {RETURN}
TAB {TAB}
UP ARROW {UP}
Key Code
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 keys with Precede the key code by
Ctrl ^ (caret)
To assign a procedure to one of the special characters (+, ^, %, and so on), enclose the
character in braces. For details, see the example.
Example
This example assigns InsertProc to the key sequence Ctrl+Plus Sign, and assigns
SpecialPrintProc to the key sequence Shift+Ctrl+Right Arrow.
VBCopy
Application.OnKey "^{+}", "InsertProc"
Application.OnKey "+^{RIGHT}", "SpecialPrintProc"
Shortcut Keys
Function Keys
F1 Displays help on a keyword or (Help > Microsoft Visual Basic for Applications
Help).
F2 Displays the (View > Object Browser) window.
F3 Finds the next occurrence of the last word you searched for using (Ctrl + F).
F4 Displays the (View > Properties Window) if it is not displayed.
F5 Runs the current procedure or continues if in Debug Mode.
F6 Switches focus between the two code windows when using (Window > Split).
F7 Displays the (View > Code) window. Can also be used to display the corresponding
userform code module when a Userform is active.
F8 Step into code line by line. Can be used to startd debugging subroutines that require
no arguments.
F9 Inserts or toggles a breakpoint.
F10 Toggles the activatation of the Menu bar.
Shift + Function
Ctrl + Function
Ctrl + F2 Activates the Object Box in the top left corner of the Code window.
Ctrl + F4 Closes the active MDI child window.
Ctrl + F5 Runs the error handler code or returns the error to the calling procedure. Does
not affect the setting for error trapping on the General tab of the Options dialog
box.
Ctrl + F6 Moves to the next open window. This is exactly the same as (Ctrl + Tab).
Ctrl + F8 Run to the cursor.
Ctrl + F9 Moves the current line of execution to this location. This defines the location for
the next command that is executed.
Ctrl + F10 Activate the Menu bar.
Other + Function
Alt + F4 Closes the Visual Basic Editor window and returns to the application.
Alt + F5 Resume execution though the error handler / run error handler.
Alt + F8 Steps into the error handler or returns the error to the calling procedure. Does not
affect the setting for error trapping on the General tab of the Options dialog box.
Alt + F11 Toggles between the Visual Basic Editor and the application.
Ctrl + Shift + F2 Moves back to the previous position (View > Last Position).
Ctrl + Shift + F8 Step out of code.
Ctrl + Shift + F9 Clear all breakpoints from the active project.
Ctrl + Letters
Other + Letters
Entering
Extending
Shift + Left Arrow Extends the selection one character to the left.
Shift + Right Arrow Extends the selection one character to the right.
Shift + Up Arrow Extends the selection up one line.
Shift + Down Arrow Extends the selection down one line.
Manouvering
Other
Backspace Deletes the character to the left of the cursor in the code window.
Ctrl + Break Stops execution and enters break-mode.
Ctrl + Insert Copies the selection to the clipboard.
Ctrl + Enter Enters a new line (or carriage return) into a userform control.
Ctrl + Delete Delete to the end of the word.
Ctrl + Spacebar Displays a drop-down of matching properties (Edit > Complete Word). This is
only useful if you have (Tools > Options, Editor tab, Auto List members)
unchecked.
Ctrl + Backspace Deletes to the start of the word.
Alt + Spacebar Activates the Control Box in the top left hand corner of the visual basic editor
window.
Alt + Backspace Undo the last action (Edit > Undo).
Insert Toggle Insert Mode.
Delete Delete the character to the right of the cursor in the code window.