Chapter 4. Creating Code from Scratch in the Visual Basic Editor

In this chapter, you'll practice creating procedures from scratch in the Visual Basic Editor. The examples walk you through creating a procedure in Word, Excel, and PowerPoint.

For the examples in this book, the Visual Basic Editor should be set up a certain way, and (for good practice) set to require explicit declarations of variables. So we'll start off this chapter by ensuring that these conditions are met.

The purpose of this chapter is to give you a feel for creating code in the Visual Basic Editor before you study the details of the language. You'll work quickly with VBA elements (such as objects, properties, methods, variables, and constants) that you'll learn about more fully ...

Get Mastering VBA for Microsoft® Office 2010 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.