Navigating and Selecting Code in VBA

By Alan Simpson

Part of Access VBA Programming For Dummies

Use these VBA shortcuts in the Code window (used for writing, editing, and viewing VBA) and the Immediate window (which lets you run code any time, right on the spot) to get your jobs done quickly.

Action Shortcut Key
Move cursor right one character
Select character to right Shift+→
Move cursor right one word Ctrl+→
Select to end of word Ctrl+ Shift+→
Move cursor left one character
Select character to left of cursor Shift+←
Move cursor left one word Ctrl+←
Move cursor to start of line Home
Select text to start of line Shift+Home
Move cursor to end of line End
Select text to end of line Shift+End
Move cursor up a line
Move cursor down a line
Move cursor to next procedure Ctrl+↓
Move cursor to previous procedure Ctrl+↑
Scroll up one screen PgUp
Scroll down one screen PgDn
Go to top of module Ctrl+Home
Select all text to top of module Ctrl+ Shift+Home
Go to bottom of module Ctrl+End
Select all text to bottom of module Ctrl+ Shift+End
Cut selection Ctrl+X
Copy selection Ctrl+C
Paste selection Ctrl+V
Cut current line to Clipboard Ctrl+Y
Delete to end of word Ctrl+Delete
Delete character or selected text Delete (Del)
Delete character to left of cursor Backspace
Delete to end of word Ctrl+Delete
Delete to beginning of word Ctrl+Backspace
Undo Ctrl+Z
Indent line Tab
Outdent line Shift+Tab
Find Ctrl+F
Replace Ctrl+H
Find Next F3
Find Previous Shift+F3
Get help with currently selected word F1
Quick Info Ctrl+I