Chapter 23 Introducing VBA

In This Chapter

  • An introduction to VBA
  • How to use the Visual Basic Editor
  • How to work in the code windows of the Visual Basic Editor

VBA (Visual Basic for Applications) is Excel’s programming language, and it is used to create macros and custom worksheet functions that you can employ in formulas. In its broadest sense, a macro is a sequence of instructions that automates some aspect of Excel so that you can work more efficiently and with fewer errors.

Excel programming terminology can be a bit confusing. For example, VBA is a programming language, but it also serves as a macro language. What do you call something written in VBA and executed in Excel? Is it a macro or is it a program? Excel’s Help system often refers to VBA procedures as macros, so this is the terminology used in this book.

Over the next few chapters, we will introduce you to the world of VBA through the prism of creating worksheet functions. But before you can create custom functions by using VBA, you need to have some basic background knowledge of VBA as well as some familiarity with the Visual Basic Editor (VBE).

Fundamental Macro Concepts

Most Excel users think of macros as a way of recording actions so that Excel can duplicate those actions on demand. 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 on a cell phone, you can ...

Get Excel 2016 Formulas 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.