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 chapter assumes that you have the Visual Basic Editor arranged in a default configuration and (for good practice) set to require explicit declarations of variables, so the chapter starts by making sure you have it set up like this. The examples then walk you through creating a procedure in Word, Excel, and PowerPoint.

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. In this chapter, you’ll work quickly with VBA elements (such as objects, properties, methods, variables, and constants) that you’ll ...

Get Mastering VBA for Microsoft Office 2007, 2nd Edition 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.