Chapter 12. Basic VBA and Macros

Even if you know nothing about VBA and macros, you may find that some of the tips in this section whet your appetite to learn more. And, if you're just starting out with macros, you'll find some useful tips in this part.

Tips and Where to Find Them

  • Tip 203 Learning about Macros and VBA 435

  • Tip 204 Recording a Macro 437

  • Tip 205 Executing Macros 439

  • Tip 206 Understanding Functions Versus Subs 442

  • Tip 207 Creating Simple Worksheet Functions 444

  • Tip 208 Describing Function Arguments 447

  • Tip 209 Making Excel Talk 449

  • Tip 210 Understanding Custom Function Limitations 450

  • Tip 211 Executing a Ribbon Command with a Macro 451

  • Tip 212 Understanding Security Issues Related to Macros 453

  • Tip 213 Using a Personal Macro Workbook 455

Learning about Macros and VBA

The terms macro and VBA remain a mystery to most Excel users. This tip provides a broad overview to help you decide whether learning to create Excel macros would be useful.

What is a macro?

A macro is a sequence of instructions that automates some aspect of Excel so that you can work more efficiently and with fewer errors. You use the scripting language Visual Basic for Applications (VBA) to create macros. You might create a macro, for example, to import data from a text file, format it, and save it as a workbook. After the macro is developed, you can then execute the macro to perform many time-consuming procedures automatically.

You need not be a power user to create and use simple VBA macros. Casual users can simply ...

Get John Walkenbach's Favorite Excel 2010 Tips and Tricks 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.