Introduction to the VBA Language and Code Structure

The easiest way to begin learning VBA is to record macros and then look at what you’ve recorded in the Visual Basic Editor. In the subsections that follow, we’ll use this method to help you become acquainted with how to read VBA code.

Note

Macros can no longer be recorded in PowerPoint (which has always been the most limited of the three programs in terms of VBA capabilities), but you can still write VBA macros in PowerPoint. Macros can be recorded and written in Word and Excel.

So, what is a macro? A macro is simply a set of commands that can be executed together, similar to a paragraph style. However, where a style is a collection of settings that you can apply at once, a macro is a collection ...

Get 2007 Microsoft® Office System Inside Out now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.