any regular users of Excel ﬁnd that they are often
repeating the same series of spreadsheet tasks through
several mouse clicks and/or keystrokes. If you become
such a user, you may want to save on keystrokes or mouse clicks
through the macro feature of Excel. Furthermore, you may ﬁnd
that Excel—despite having several hundred built-in functions—does
not have a function that matches your speciﬁc needs for a project
and you may want to create one using Visual Basic for Applications
(VBA), a programming language designed exclusively to be used
with Excel and other Microsoft Ofﬁce applications.
In this chapter we look at how to create macros by recording and
how to run them via buttons and graphic objects. We also introduce
and add the Developer tab to the Ribbon so that we can work with
Visual Basic Editor to perform editing of macros already recorded. The
Visual Basic Editor is used to create and modify programs in VBA
that will be discussed in the following chapters.
A macro is an automated series of Excel steps that can be executed through a single
command. The series of steps may be as simple as selecting a range of cells and
formatting them in terms of font and background color or it may be complex enough
to involve some arithmetic and logical manipulation of information in certain cells.
The advantage of using macros for repetitive tasks in Excel is that a task can be
executed through a single macro command.