Shortcut Keys

Function Keys

F1Displays help on a keyword or (Help > Microsoft Visual Basic Help)
F2Displays the (View > Object Browser) window
F3Finds the next occurrence of the last word you searched for using (Ctrl + F)
F4Displays the (View > Properties Window)
F5Runs the current procedure or continues if in Debug Mode
F6Switch split windows
F7Displays the (View > Code) window (inc. userform code module)
F8Step into code line by line
F9Inserts or toggles a breakpoint
F10Toggles the activatation of the Menu bar


Shift + Function

Shift + F1??
Shift + F2Moves to the definition of the procedure or function (View > Definition)
Shift + F3Finds the previous occurrence of the last word you searched for using (Ctrl + F)
Shift + F4Repeats the last Find, the same as (Edit > Find Next)
Shift + F7(View > Object) ??
Shift + F8Step over code line by line, execute one procedure at a time
Shift + F9Activates the Quick Watch window adding the current variable
Shift + F10Displays the (Shortcut) menu for the selected item


Ctrl + Function

Ctrl + F2Activates the Object Box in the top left corner of the Code window
Ctrl + F4Closes the active MDI child window
Ctrl + F5Starts with a full compile ??
Ctrl + F8Run to the cursor
Ctrl + F9Determines the location of the next command
Ctrl + F10Activate the Menu bar


Other + Function

Alt + F4Closes the Visual Basic Editor window and returns to the application
Alt + F5Resume execution though the error handler / run error handler
Alt + F6Switch between last 2 active windows
Alt + F7Step Error handler ??
Alt + F8Displays the (Tools > Macro > Macros) dialog box
Alt + F11Toggles between the Visual Basic Editor and the application
Ctrl + Shift + F2Moves back to the previous position (View > Last Position)
Ctrl + Shift + F8Step out of code
Ctrl + Shift + F9Clear all breakpoints from the active project


Ctrl + Letters

Ctrl + ASelect all text in the current module
Ctrl + CCopies the selection to the clipboard
Ctrl + EDisplays the (File > Export File) dialog box
Ctrl + FDisplays the (Edit > Find) dialog box
Ctrl + GDisplays the (View > Immediate window) window
Ctrl + HDisplays the (Edit > Replace) dialog box
Ctrl + ITurn on quick information (Edit > Quick Info)
Ctrl + JDisplays a drop-down of available properties (Edit > List Properties/Methods)
Ctrl + LShow the call stack (View > Call Stack)
Ctrl + MDisplays the (File > Import File) dialog box
Ctrl + NNew line ??
Ctrl + PDisplays the (File > Print) dialog box
Ctrl + QClose and Return ??
Ctrl + RDisplays the (View > Project Explorer) window
Ctrl + SSaves (File > Save)
Ctrl + TShow available components ??
Ctrl + VPastes the current clipboard entry
Ctrl + XCuts the selection to the clipboard
Ctrl + YCuts the entire line to the clipboard
Ctrl + ZUndo the last action (Edit > Undo)


Other + Letters

Alt + ADisplays the (Add-Ins) menu
Alt + DDisplays the (Debug) menu
Alt + EDisplays the (Edit) menu
Alt + FDisplays the (File) menu
Alt + HDisplays the (Help) menu
Alt + IDisplays the (Insert) menu
Alt + ODisplays the (Format) menu
Alt + QCloses the Visual Basic Editor window and returns to application
Alt + RDisplays the (Run) menu
Alt + TDisplays the (Tools) menu
Alt + VDisplays the (View) menu
Alt + WDisplays the (Window) menu
Ctrl + Shift + IDisplays the tooltip showing you parameter information (Edit > Parameter Info)*
Ctrl + Shift + JDisplays a drop-down of available constants (Edit > List Constants)*

Note: * CHECK - These are only useful if you have (Tools > Options, Editor tab, Auto List Members & Auto Quick Info) unchecked.


Entering

Shift + InsertPaste ???
TabIndents the current line of code or completes intellisense
Shift + TabUnIndents the current line of code (outdents)
EnterEnters a new line into the code module


Selecting

Shift + HomeSelects to the start of the line
Shift + EndSelects to the end of the line
Shift + Page UpSelects to the top of the module
Shift + Page DownSelects to the bottom of the module


Extending

Shift + Left ArrowExtends the selection one character to the left
Shift + Right ArrowExtends the selection one character to the right
Shift + Up ArrowExtends the selection up one line
Shift + Down ArrowExtends the selection down one line


Manouvering

Ctrl + TabMoves to the next module or window
Alt + TabMoves to the next application
HomeMoves to the beginning of the current line
EndMoves to the end of the current line
Page UpMoves one screen upwards
Page DownMoves one screen downwards
Left ArrowMoves left one character
Right ArrowMoves right one character
Up ArrowMoves up one line
Down ArrowMoves down one line
Ctrl + HomeMoves to the top of the module
Ctrl + EndMoves to the bottom of the module
Ctrl + Page UpMoves to the top of the current procedure
Ctrl + Page DownMoves to the start of the next procedure
Ctrl + Left ArrowMoves one word to the left
Ctrl + Right ArrowMoves one word to the right
Ctrl + Up ArrowMoves to the sub or function directly above
Ctrl + Down ArrowMoves to the sub or funciton directly below


Other

SpaceBar??
BackspaceDeletes the character to the left of the cursor in the code window
`Paste ??
Ctrl + BreakStops execution and enters break-mode
Ctrl + InsertCopy ??
Ctrl + Return 
Ctrl + DeleteDelete to the end of the word
Ctrl + SpacebarDisplays a drop-down of matching properties (Edit > Complete Word)*
Ctrl + BackspaceDeletes to the start of the word
Alt + SpacebarActivates the Control Box in the top left hand corner
Alt + BackspaceUndo the last action (Edit > Undo)
Shift + Space??
InsertToggle Insert Mode
DeleteDelete the character to the right of the cursor in the code window
Ctrl + _ 

Note: * CHECK This is only useful if you have (Tools > Options, Editor tab, Auto List members) unchecked.


Detecting the Shift, Ctrl or Alt Keys

The following function uses a Windows Api call to detect if the shift, ctrl and/or alt keys are pressed.

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer 

Function GetShiftCtrlAlt() As Integer
Dim iKeys As Integer

Const VK_SHIFT As Long = &H10
Const VK_CONTROL As Long = &H11
Const VK_ALT As Long = &H12

If GetAsyncKeyState(VK_SHIFT) <> 0 Then iKeys = iKeys + 1
If GetAsyncKeyState(VK_CONTROL) <> 0 Then iKeys = iKeys + 1
If GetAsyncKeyState(VK_ALT) <> 0 Then iKeys = iKeys + 1

GetShiftCtrlAlt = iKeys
End Function



© 2017 Better Solutions Limited. All Rights Reserved. © 2017 Better Solutions Limited

PrevNext