Welcome to Excel 2007 Power Programming with VBA . If your job involves developing spreadsheets that others will use - or if you simply want to get the most out of Excel - you've come to the right place.
This book focuses on Visual Basic for Applications (VBA), the programming language built into Excel (and other applications that make up Microsoft Office). More
This book does not cover Microsoft Visual Studio Tools for Office (VSTO). VSTO is a relatively new technology that uses Visual Basic .NET and Microsoft Visual C#. VSTO can also be used to control Excel and other Microsoft Office applications.
This is not a book for beginning Excel users. If you have no experience with Excel, a better choice might be my
Excel 2007 Bible,
which provides comprehensive coverage of all the features of Excel. That book is
To get the most out of this book, you should be a relatively
How to create workbooks, insert sheets, save files, and so on
How to navigate through a workbook
How to use the Excel 2007 Ribbon
How to enter formulas
How to use Excel's worksheet functions
How to use basic Windows features, such as file management techniques and the Clipboard
If you don't know how to perform the
To make the best use of this book, you need a copy of Excel 2007. Although most of the material also applies to Excel 2000 and later versions, I assume that you are using Excel 2007. Although Excel 2007 is
Most of the material in this book also applies to Excel for Macintosh. However, I did no compatibility testing with the Mac version, so you're on your own.
Any computer system that can run Windows will suffice, but you'll be much better off with a fast machine with plenty of memory. Excel is a large program, and using it on a slower system or a system with minimal memory can be extremely frustrating.
I recommend using a high-resolution video driver (1024 — 768 is adequate, and 1600 — 1200 is even better). For optimal results, try a
To use the examples on the companion CD, you also need a CD-ROM drive.
Take a minute to skim this section and learn some of the typographic conventions used throughout this book.
Excel 2007 features a brand new "
The convention I use in this book is to
Home Alignment Wrap Text
The large round icon in the upper left corner of Excel 2007's window is
Office Excel Options
The VBA editor is the window in which you work with your VBA code. The VBA editor uses the traditional menu-and-toolbar interface. A command like the following means to click the Tools menu and select the References menu item:
You need to use the keyboard to enter data. In addition, you can work with
Input that you type from the keyboard appears in boldface - for example, enter =SUM(B2: B50) into cell B51.
More lengthy input usually appears on a separate line in a monospace font. For example, I might instruct you to enter the following formula:
This book contains many snippets of VBA code as well as complete procedure listings. Each listing appears in a monospace font; each line of code occupies a separate line. (I
If a line of code doesn't fit on a single line in this book, I use the standard VBA line continuation sequence: At the end of a line, a space followed by an
If Right(ActiveCell, 1) = "!" Then ActiveCell _ = Left(ActiveCell, Len(ActiveCell) - 1)
You can enter this code either on two lines, exactly as shown, or on a single line without the underscore character.
Excel's worksheet functions appear in uppercase font, like so: "Enter a SUM formula in cell C20." VBA procedure
I also use the monospace font for filenames and named ranges in a worksheet - for example: Open myfile.xlsm and select the range named data.
If you're reading this book, you're well versed in mouse usage. The mouse terminology I use is all standard fare: pointing, clicking, right-clicking, dragging, and so on.