Excel 2010 Bible

(National Geographic (Little) Kids) #1

Chapter 39: Introducing Visual Basic for Applications


801


Cross-Reference
Creating VBA functions that you use in worksheet formulas can simplify your formulas and enable you to per-
form calculations that otherwise may be impossible. Chapter 40 discusses VBA functions in greater detail. n


If you’re new to VBA, you may be overwhelmed by the terminology. I’ve put together some key definitions
to help you keep the terms straight. These terms cover VBA and UserForms (custom dialog boxes) — two
important elements that are used to customize Excel:

l Code: VBA instructions that are produced in a module sheet when you record a macro. You
also can enter VBA code manually.
l Controls: Objects on a UserForm (or in a worksheet) that you manipulate. Examples include
buttons, check boxes, and list boxes.
l Function: One of two types of VBA macros that you can create. (The other is a Sub proce-
dure.) A function returns a single value. You can use VBA functions in other VBA macros or
in your worksheets.
l Macro: A set of VBA instructions performed automatically.

l (^) Method: An action taken on an object. For example, applying the Clear method to a Range
object erases the contents and formatting of the cells.
l (^) Module: A container for VBA code.
l (^) Object: An element that you manipulate with VBA. Examples include ranges, charts, drawing
objects, and so on.
l (^) Procedure: Another name for a macro. A VBA procedure can be a Sub procedure or a
Function procedure.
l Property: A particular aspect of an object. For example, a Range object has properties, such
as Height, Style, and Name.
l (^) Sub procedure: One of two types of Visual Basic macros that you can create. The other is a
function.
l (^) UserForm: A container that holds controls for a custom dialog box and holds VBA code to
manipulate the controls. (Chapters 41 and 42 explain UserForms in depth.)
l (^) VBA: Visual Basic for Applications. The macro language that is available in Excel, as well as
in the other applications in Microsoft Office.
l (^) VB Editor: The window (separate from Excel) that you use to create VBA macros and
UserForms. Use Alt+F11 to toggle between Excel and the VB Editor.
Some Definitions

Free download pdf