Start using Code VBA
This page gives an overview of the main Code VBA features. First, a shortlist of the tools included and their benefits. After that, the elements added to the Visual Basic editor by Code VBA: the Code Explorer, the Code VBA toolbar and Code VBA IntelliSense.
Benefits of Code VBA
- Write code faster using VBA code generators.
- The VBA coding assistent IntelliSense proposes suitable continuations for the current statement.
- An extensive VBA code library with useful functions and code snippets.
- Easy working with your Office application's objects.
- Advanced support for error handling.
- Advanced tools for common code tasks such as the userform, class or recordset builders.
- Procedure management and navigation using the Code Explorer.
- The code indenter makes code well organized and easier to understand.
- Easily comment out and in blocks of code or complete procedures.
- Direct access to MS Office VBA online documentation.
Code VBA toolbar and menus
The toolbar and menus give access to all Code VBA features. To get an idea of what is included it makes sense to open them each to see what is there. The menus in the toolbar starting from Procedure is a subset of what can be found under the Code VBA menu (left). The duplication is done to increase accessibility to the most used code insertion actions. When you have familiarized yourself using Code VBA you may also want to see what's extra under the Code VBA menu.
Example 1: If menu
Below shows an example of the continuations available for the if condition code insertion.


When the mouse pointer hovers a menu item, relevant information is displayed. For 'leaf' menu items that are to insert code this concerns:
- ... in the menu caption indicates a dialog will open before actual insertion (image right). Note that in this dialog you can again see the code block, now expanded with a selected value from the variables available in the current code;
- A descriptive title;
- The code that will be inserted;
- 'Press F1' to bring you to the online documentation if available.
Example 2: Dialog menu

The Dialog menu gives access to all tools that concern user interaction. Some tools, such as MsgBox Builder, are common to all Office applications, others are only available for some, e.g. Rename Sheet only in Excel.
DatePicker and SelectionBox are procedures included in the VBA code library.
Some tools appear automatically when you are writing code. For example the InputBox Builder by default appears after typing 'inp'.
Code Explorer
When you open the Visual Basic Editor, you will see the the Code Explorer dockable window floating around. The first thing you will do is dock it. A good place for the Code Explorer is on the left of the edit pane, replacing the Project Explorer (close it).
The Code Explorer is an extended replacement for the Project Explorer: where the latter only lets you act on the modules in a project, the Code Explorer also shows the procedures in each module - and lets you act on each:
- If the procedure is a macro you can Run it;
- Easily navigate to a procedure using Go To
- Immediate opens that window and inserts the procedure in it for repeated execution.
- and more ...

Code VBA IntelliSense
Code VBA IntelliSense provides active support while your are coding. Based on your current line and what you are typing it proposes continuations and pops up code builders. These are based on deep knowledge of the VBA language and Office application's objects combined with practical programming.
Common Code VBA IntelliSense uses

- After typing if, do or dim the appropriate menu on the Code VBA toolbar opens. (If/Select, Loop or Variable.)
- After = when coding a value expression a menu opens in which you can either introduce a new variable,
start an appropriate expression builder, select suitable (same type) variables from variables or object properties and
from built-in or your own functions. The menu also opens when using
Shift-Space after operators in the expression (&,>,< , +,-,And,Or,Not) - At a position where a condition expression is expected (after If, or While or Until) IntelliSense opens the Boolean expression continuations menu.
- Set object variable: select from procedures that return an object of this type.
Managing IntelliSense behaviour
Initially preferences are set to have the continuations and builders pop up autonomously for all identified trigger conditions. When you first start using Code VBA you may also find this spontanuous help an interference.
You can shift the initiative to yourself changing triggers preferences and using shortcut key to initiate the IntelliSense yourself:
- Change preferences for triggers
- Initiate IntelliSense yourself using Shift-Space or Shift-Space