Visit www.dummies.com/go/excelvbaprogrammingfd3e to view this book's cheat sheet.
Table of Contents
So You Want to Be a Programmer. . . .
Obligatory Typographical Conventions Section
Part I: Getting Started with Excel VBA Programming
Part II: How VBA Works with Excel
Part III: Programming Concepts
Part IV: Communicating with Your Users
Part V: Putting It All Together
Part I: Getting Started with Excel VBA Programming
Automating a task you perform frequently
Automating repetitive operations
Developing new worksheet functions
Creating custom add-ins for Excel
Creating complete, macro-driven applications
Advantages and Disadvantages of VBA
Saving Workbooks That Contain Macros
More about the NameAndTime Macro
Part II: How VBA Works with Excel
Chapter 3: Working in the Visual Basic Editor
What Is the Visual Basic Editor?
Working with the Project Window
Exporting and importing objects
Minimizing and maximizing windows
Getting VBA code into a module
Customizing the VBA Environment
Chapter 4: Introducing the Excel Object Model
Wrapping Your Mind around Collections
Navigating through the hierarchy
Diving into Object Properties and Methods
Automatically listing properties and methods
Chapter 5: VBA Sub and Function Procedures
Looking at Function procedures
Executing the Sub procedure directly
Executing the procedure from the Macro dialog box
Executing a macro by using a shortcut key
Executing the procedure from a button or shape
Executing the procedure from another procedure
Calling the function from a Sub procedure
Calling a function from a worksheet formula
Chapter 6: Using the Excel Macro Recorder
Part III: Programming Concepts
Chapter 7: Essential VBA Language Elements
Using Comments in Your VBA Code
Using Variables, Constants, and Data Types
Declaring and scoping variables
Chapter 8: Working with Range Objects
Other Ways to Refer to a Range
Some Useful Range Object Properties
Some Useful Range Object Methods
Chapter 9: Using VBA and Worksheet Functions
VBA functions that do more than return a value
Using Worksheet Functions in VBA
More about using worksheet functions
Chapter 10: Controlling Program Flow and Making Decisions
Using For Each-Next Loops With Collections
Chapter 11: Automatic Procedures and Events
Programming event-handler procedures
Writing an Event-Handler Procedure
The BeforeClose event for a workbook
The BeforeSave event for a workbook
Activate and deactivate events in a sheet
Activate and deactivate events in a workbook
Other Worksheet-Related Events
Events Not Associated with Objects
Chapter 12: Error-Handling Techniques
The macro is still not perfect
Revisiting the EnterSquareRoot procedure
Chapter 13: Bug Extermination Techniques
Inserting Debug.Print statements
Setting breakpoints in your code
Chapter 14: VBA Programming Examples
Copying a variable-sized range
Selecting to the end of a row or column
Looping through a range efficiently
Looping through a range efficiently (Part II)
Determining the selection type
Identifying a multiple selection
Looping through the ChartObjects collection
Turning off automatic calculation
Eliminating those pesky alert messages
Using the With-End With structure
Part IV: Communicating with Your Users
Chapter 15: Simple Dialog Boxes
Displaying a simple message box
Getting a response from a message box
The syntax for the GetOpenFilename method
Displaying Excel’s Built-in Dialog Boxes
Knowing When to Use a UserForm
Creating UserForms: An Overview
Changing properties for a UserForm control
Viewing the UserForm Code window
Using information from a UserForm
Adding event-handler procedures
Creating a macro to display the dialog box
Chapter 17: Using UserForm Controls
Getting Started with Dialog Box Controls
Introducing control properties
Dialog Box Controls: The Details
Working with Dialog Box Controls
Chapter 18: UserForm Techniques and Tricks
Writing code to display the dialog box
Adding event-handler procedures
Using multiple sets of OptionButtons
Using a SpinButton and a TextBox
Using a UserForm as a progress indicator
Creating a modeless tabbed dialog box
Displaying a chart in a UserForm
Chapter 19: Accessing Your Macros through the User Interface
Customizing the Ribbon manually
Customizing the Ribbon with XML
Commanding the CommandBars collection
Referring to controls in a CommandBar
Properties of CommandBar controls
Resetting all built-in, right-click menus
Adding a new item to the Cell shortcut menu
Part V: Putting It All Together
Chapter 20: Creating Worksheet Functions — and Living to Tell about It
Understanding VBA Function Basics
Working with Function Arguments
A function with a range argument
A function with an optional argument
Functions That Return an Array
Returning an array of month names
Using the Insert Function Dialog Box
Displaying the function’s description
Chapter 21: Creating Excel Add-Ins
Okay . . . So What’s an Add-In?
Adding descriptive information
Chapter 22: Ten VBA Questions (and Answers)
Chapter 23: (Almost) Ten Excel Resources
Chapter 24: Ten VBA Do’s and Don’ts
Don’t Confuse Passwords with Security
Don’t Put Everything in One Procedure
Don’t Assume That Everyone Enables Macros
Do Get in the Habit of Experimenting
Don’t Assume That Your Code Will Work with Other Excel Versions