Chapter 1: Getting Started with Excel Macros

You need not be a power user to create and use simple VBA macros. Even casual users can simply turn on Excel's macro recorder.

Recording a macro is like programming a phone number into your cell phone. You first manually dial and save a number. Then when you want, you can redial those numbers with the touch of a button. Just as with numbers on a cell phone, you can record your actions in Excel while you perform them. While you record, Excel gets busy in the background, translating your keystrokes and mouse clicks to written VBA code. After you've recorded a macro, you can play back those actions anytime you wish.

This Part serves as an introduction to Excel Macros and VBA in general. Here, we give you a concise summary of how VBA works with Excel, giving you the basic foundation you need to work with the 101 macros listed in this book.

Becoming Familiar with Macro Recording Basics

To start recording your first macro, you need to first find the Macro Recorder, which is on the Developer tab. Unfortunately, Excel comes out of the box with the Developer tab hidden — you may not see it on your version of Excel at first. If you plan to work with VBA macros, you'll want to make sure that the Developer tab is visible. To display this tab

1. Choose Office⇒Excel Options.

2. In the Excel Options dialog box, select Customize Ribbon.

3. In the list box on the right, place a check mark next to Developer.

4. Click OK to return to Excel.

Now that ...

Get 101 Ready-To-Use Excel Macros now with O’Reilly online learning.

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