
Chapter 11 VBA Programming244
VBA code, we will take one more look at the environment for VBA coding by writing
a macro from scratch.
Writing a Macro
The macro that we are going to write will rename the worksheets of an active workbook
as “Red-Sheet,” “Green-Sheet,” and “Blue-Sheet.” It will also select the cells A1:G1 in
each sheet and set their font size to 20 and font color to red, green, and blue, respec-
tively.
We will begin by activating Excel to open a new workbook which will be given the
default name of Book1 or something like that by Excel. To write the macro we need to
activate the Visual Basic Editor; you can do so by choosing any