Datasheet

Chapter 1: Using Macros and Form Controls
9
A macro you create in Excel can have a relative, absolute, or mixed reference. If you use a relative reference,
Excel performs the macro based on a relative location. For example, suppose you move up two cells from cell
A3 to A1 when creating your macro. When you run your macro, if you are in cell C3, Excel moves up two cells
from cell C3 to C1. However, if you use an absolute reference, Excel performs the macro based on the exact
cell addresses. For example, suppose again that you move up two cells from cell A3 to A1. When you run your
macro, if you are in cell C3, Excel moves from there to the cells you used when you recorded your macro. That
is, Excel moves from cell A3 to cell A1.
By default, Excel creates macros with an absolute reference. To create a macro with a relative reference, click
the Use Relative Reference button on the Developer tab to toggle the relative reference option on. To create a
macro with both a relative and an absolute reference — a mixed reference — toggle the Use Relative Reference
on and off as needed as you create your macro.
8
9
0
You are now ready to record your macro.
8 Perform the steps you want to record.
This example changes the number format.
9 Click the Developer tab.
Alternatively, click the Stop Recording button
on the status bar and skip step 10.
0 Click Stop Recording in the Code group.
Excel stops recording your macro.
Your macro is ready for you to use.
Note:
See the section, “Run a Macro,” to learn how
to run a macro.
04_132302 ch01.qxp 7/27/07 9:20 PM Page 9