Microsoft Office Tutorials and References
In Depth Information
Typing and Editing in the Code Window
Table 2-2 (continued)
Action
Shortcut Key
Delete character to left of cursor
Backspace
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
View Object Browser
F2
View Immediate window
Ctrl+G
View Code window
F7
View shortcut menu
Shift+F10 (or right-click)
Get help with selected word
F1
Run current sub procedure
F5
Stop code execution
Ctrl+Break
Typing comments
When typing VBA code, you can mix in programmer comments (usually
called comments for short). A comment is plain-English text for human
consumption only. VBA ignores all comments and processes only the code. As
such, comments are optional. The purpose of adding a comment is simply to
jot down notes within the code as a future reminder to yourself or to other
programmers working on the same project.
The first character of a comment must be an apostrophe (’). In the Code
window, comments appear as green text. Each comment is on its own line or
follows a line of VBA code. Never put VBA code to the right of a comment on
the same line, because VBA assumes that all text after the apostrophe (on
the same line) is just a comment and ignores everything to the right of the
apostrophe.
Breaking lines of code
Unlike a word processor, in which long lines of text are word-wrapped (broken
between words as necessary), text in Visual Basic Editor never wraps. You
(and Access) really need to be able to see each line independently. If Visual
Search JabSto ::




Custom Search