Excel 2002 Power
Programming with VBA
John Walkenbach
M&T Books
An imprint of Hungry Minds, Inc.
New York, NY ✦ Cleveland, OH ✦ Indianapolis, IN
How This Book Is Organized
The chapters of this book are grouped into seven main parts. In addition, I’ve
included a few appendixes that provide supplemental information.
Part I: Some Essential Background
In this part, I set the stage for the rest of the book. Chapter 1 presents a brief history
of spreadsheets so that you can see how Excel fits into the big picture. In Chapter 2,
I offer a conceptual overview of Excel 2002 — quite useful for experienced spreadsheet users who are switching to Excel. In Chapter 3, I cover the essentials of
formulas, including some clever techniques that may be new to you. Chapter 4
covers the ins and outs of the various files used and generated by Excel.
Part II: Excel Application Development
This part consists of just two chapters. In Chapter 5, I broadly discuss the concept
of a spreadsheet application. Chapter 6 goes into more detail and covers the steps
typically involved in a spreadsheet application development project.
Part III: Understanding Visual Basic for Applications
Chapters 7 through 11 make up Part III, and these chapters include everything you
need to know to learn VBA. In this part, I introduce you to VBA, provide programming fundamentals, and detail how to develop VBA subroutines and functions.
Chapter 11 contains tons of useful VBA examples.
Part IV: Working with UserForms
The four chapters in this part cover custom dialog boxes (also known as UserForms).
Chapter 12 presents some built-in alternatives to creating custom UserForms.
Chapter 13 provides an introduction to UserForms and the various controls you
can use. Chapters 14 and 15 present many examples of custom dialog boxes, ranging from basic to advanced.
Part V: Advanced Programming Techniques
Part V covers additional techniques that are often considered advanced. The first
three chapters discuss how to develop utilities and how to use VBA to work with
pivot tables and charts. Chapter 19 covers the topic of event-handling, which
enables you to execute procedures automatically when certain events occur.
Chapter 20 discusses various techniques that you can use to interact with other
applications (such as Word). Chapter 21 concludes Part V with an in-depth discussion of creating add-ins.
Part VI: Developing Applications
The chapters in Part VI deal with important elements of creating user-oriented
applications. Chapters 22 and 23 provide information on creating custom toolbars
and menus. Chapter 24 presents several different ways to provide online help for
your applications. In Chapter 25, I present some basic information about developing user-oriented applications, and I describe such an application in detail.
Part VII: Other Topics
The five chapters in Part VII cover additional topics that you may find helpful.
Chapter 26 presents information regarding compatibility. In Chapter 27, I discuss
various ways to use VBA to work with files. In Chapter 28, I explain how to use VBA
4799-2 FM.F 6/11/01 1:12 PM Page xiiixiv Preface
to manipulate Visual Basic components such as UserForms and modules. Chapter
29 covers the topic of class modules. I finish the part with a useful chapter that
answers many common questions about Excel programming.
Appendixes
Five appendixes round out the book. Appendix A contains useful information about
Excel resources online. Appendix B is a reference guide to all of VBA’s keywords
(statements and functions). I explain VBA error codes in Appendix C, and Appendix
D is a handy ANSI code reference chart. The final appendix describes the files available on the companion CD-ROM