Microsoft Office Tutorials and References
In Depth Information
Introducing the Visual Basic Editor
The Immediate window is most useful for executing VBA statements directly, testing statements,
and debugging your code. This window may or may not be visible. If the Immediate window is
not visible, press Ctrl+G. To close the Immediate window, click the Close button on its title bar.
Using the Project window
When you work in the VB Editor, each Excel workbook and add-in that’s currently open is
considered a project. You can think of a project as a collection of objects arranged as an outline. You
can expand a project by clicking the plus sign (+) at the left of the project’s name in the Project
window. To contract a project, click the minus sign (–) to the left of a project’s name. Figure 22-7
shows the Project window with two projects listed. One of the projects (MyFunction.xlsm) is
expanded to show its components.
Figure 22-7: A Project window with two projects listed.
If you try to expand a project that is password protected, Excel prompts you to enter the
Every project expands to show at least one node called Microsoft Excel Objects This node .
expands to show an item for each worksheet and chart sheet in the workbook: Each sheet is
considered an object, and ThisWorkbook represents the Workbook object. If the project has any VBA
modules, the project listing also shows a Modules node with the modules listed there. A project
may also contain a node called Forms (which contains UserForm objects) and a node called Class
Modules (which contains Class Module objects). This topic focuses exclusively on standard VBA
modules and does not cover the objects contained in the Microsoft Excel Objects node,
UserForms node, or Class Modules node.