Chapter 3 Flashcards
VBE stands for this
Visual Basic Editor
Path to get shortcut menus in VBE
right-click
two methods to display Project window in VBE
Ctrl+R
View->Project Explorer
two paths to display the Immediate window
Ctrl+G
View->Immediate Window
two uses of the Immediate window
executing VBA statements directly
debugging code
In Excel 2013, this was changed for the Help system
All help information is on the Internet and is displayed in a web browser
If you don’t have Internet access and need help
download copy of the Help system from the Microsoft site using another computer
add-in file extension
.xlam
VBE Project explorer window nodes (three types)
Microsoft Excel Objects (Charts, Sheets, and This Workbook)
Modules node
Forms node
What does a Forms node contain?
UserForm objects (which hold custom dialog boxes)
How to add a new VBA module to a project
Select the project’s name
Insert -> Module
or
Right-click the project’s name
Choose Insert -> Module
To remove a module from a project
Select the module’s name in the project window
File -> Remove “module name”
or
Right-click the module’s name
Choose Remove “module name”
to export an object
Select object in the Project window
Choose File -> Export File (or press Ctrl+E)
to import an object
Select the project’s name in the Explorer window
Choose File -> Import File (or press Ctrl+M)
Locate the file, and click Open
arrange Code windows
Window -> Tile Horizontally
Window -> Tile Vertically
switch among Code windows
press Ctrl+F6
Three types of VBA module code
Declarations
Sub procedures
Function procedures
single VBA module limit
64,000 characters
(any number of sub procedures, function procedures and declarations)
three ways to get code into a VBA module
enter the code directly
use the Excel macro recorder
copy the code from another module
use this to make code easier to read
indented lines using the Tab key
Execute a procedure by placing the cursor anywhere within the text and typing this
F5
F5 is short for this
Run -> Run Sub/User Form
what does “Option Explicit” mean at the top of a module
you must declare all variables
a VBA Sub procedure is also known as this
a macro
when copying code from websites, these two things sometimes occur
quote characters may need to be converted to simple quote characters
long lines wrap around
(erroneous statements will appear in red in the VBE)
Code settings options (6) in the Editor tab under Tools->Options
Auto Syntax Check
Require Variable Declaration
Auto List Members
Auto Quick Info
Auto Data Tips
Auto Indent