Excel VBA Master Keyboard Shortcuts Cheat Sheet - ExcelVbaIsFun
Excel VBA Master Keyboard Shortcuts Cheat Sheet - ExcelVbaIsFun
Jump to Last Position. Toggles the last few places your cursor was in VBE. Ctrl + Shift + F2 Cmd + E
Indent one or more lines of code. Super handy for keeping code legible,
Tab Tab
especially for the inner parts of If Then/ End If or With/ End With statements.
Outdent (Un-indent) one or more lines of code Shift + Tab Shift + Tab
View Macro (from Excel) Alt + F8 View or Developer Ribbon
Record Macro Button (from Excel) View or Developer Ribbon View or Developer Ribbon
Open Properies Window F4 F6
Open Immediate Window Ctrl + G Ctrl + Cmd + G
Open Project Explorer. Useful if this gets closed for some reason. Ctrl + R Ctrl + Cmd + R
Autocomplete Variable/Sub/Func Name. If you're typing a declared variable,
object, constant, OR function or sub name, you can press this to autocomplete
Ctrl + Space Bar Ctrl + Space Bar
or get suggestions if you have a few items with similar spelling. Much easier
than typing really long names!
Switch Split Windows. You have to use Window->Split first to enter split mode. F6 Shift + F6
Breakpoint. Execution will pause at these points and enter Break Mode until
F9 Cmd + T
you Run or Step Through your code.
Clear All Breakpoints Ctrl + Shift + F9 Debug Menu
New Line Before Current Line Ctrl + N Cmd + N
Redo last action Alt + E + R Edit Menu
Cut Entire Line. NOT Redo last action!! Ctrl+Y is usually Redo command, but Ctrl + Y Cmd + Y
for some reason in VBE, it deletes an entire line of code. BEWARE!
Open Locals Window. You can see all objects and variables active in the
Alt + V + S View Menu
current macro. Only in break mode (while stepping through code).
Open Watch Window. You can track specific variables instead of looking at
EVERYTHING going on in the current macro. Only in break mode (while Alt + V + H View Menu
stepping through code).
Quick Watch. Adds highlighted item to Watch Window. Shift + F9 Cmd + F6
Open Object Browser. You can search for properties and methods of active
items that you have turned on in Tools->References and learn about these F2 Ctrl + Cmd + B
libraries.
Show Call Stack. You have to be in 'Debug' or Break Mode, stepping through
the code. If you are calling macros or functions and you're lost, you can view Ctrl + L Cmd + L
the Call Stack to see which macros are in play and the stack order.
View Object. If viewing code of a Userform, jumps back to the form view. Shift + F7
Align Lefts. Select multiple controls with Ctrl+Click or dragging mouse and this
Alt + O + A + L
will align them all to the last selected item
Align Centers. See above Alt + O + A + M
Align Rights. See above Alt + O + A + R
Align Tops. See above Alt + O + A + T
Align Middles. See above Alt + O + A + M
Align Bottoms. See above Alt + O + A + B
Make the Same Width. Select multiple controls with Ctrl+Click or dragging
Alt + O + M + W
mouse
Make the Same Height. See above Alt + O + M + H
Make the Same: Both (Height and Width) Alt + O + M + B
Bring to Front Ctrl + J
Send to Back Ctrl + K
Bring Forward Alt + O + O + F
Send Backward Alt + O + O + W