Microsoft Office Tutorials and References
In Depth Information
Using the Macro Recorder
figurE 2-7
using the Macro recorder
The easiest way to create a macro is to record your worksheet actions using a valuable tool called
the Macro Recorder. All you need to do is turn on the Macro Recorder, perform the actions that
comprise the task you want to automate, and then turn off the Macro Recorder when you have
finished your task. While the Macro Recorder is turned on, every action you do — selecting a cell,
entering a number, formatting a range, pretty much everything — is recorded and represented as
VBA code in a new macro. As you’ll
see, when you run the macro created by
the Macro Recorder, your task will be
completed automatically, just as you did
it manually.
The Macro Recorder comes in handy
for repetitive (and sometimes mundane)
common tasks that you’d rather not
have to keep manually doing over and
over. For example, say you manage a
table of data every day, such as shown in
Figure 2-8, that shows how many items
your company sold in its East, West,
North, and South regions.
figurE 2-8
The everyday task at hand is to sort the
table primarily by Region, then by Item,
then by Count. Your boss wants the Item
and Region columns to switch places, so
that Region occupies column A and Item
occupies column B. To improve
readability, the numbers in the Count column
must be formatted with the thousands
comma separator, and the headers for
Item, Region, and Count must be bolded.
Figure 2-9 shows the finished table, the
way your boss wants it.
figurE 2-9
Search JabSto ::

Custom Search