Introducing Visual Basic for Applications
Michael Alexander, Dick Kusleika, John Walkenbach · 2018
This chapter introduces the Visual Basic for Applications (VBA) macro language that is a key component for users who want to customize and automate Excel. It teaches the user how to record macros and create simple macro procedures. A macro is a sequence of instructions that automates some aspect of Excel so that the user can work more efficiently and with fewer errors. A VBA macro is usually one of two types: a Sub or a Function. The chapter discusses the difference between the Sub and the Function. Excel provides two ways to create macros: turn on the macro recorder and record actions; and enter the code directly into a VBA module. The chapter describes each of the two ways to create macros. It provides an introduction to VBA programming, which is essential to write (rather than record) VBA macros.