Excel: Introduction To Macros: What Is A Macro?
Excel: Introduction To Macros: What Is A Macro?
Excel: Introduction To Macros: What Is A Macro?
What is a macro?
A macro is a set of instructions that allow you to automate repetitive tasks.
Creating a Macro
Excel provides two ways to create a macro. You can use the Macro Recorder or you can type your
instructions using Visual Basic for Applications (VBA).
If you use the Macro Recorder, Excel records your commands, keystrokes, and mouse clicks and Excel
stores these instructions as VBA code. If you write your own macros, you will write the instructions in
the native VBA programming language.
Recording a Macro
In this class, we will use the DEVELOPER tab to record and run a macro. To accomplish this, you may
need to customize your Ribbon to include the DEVELOPER tab.
7. Type a brief description of what the macro does and then click the OK button to start recording
your macro.
8. Perform the steps that you want to record.
9. Click the DEVELOPER tab and click Stop Recording in the Code group.
Note: by default, a macro records absolute cell references. In the Code group, you can change this
option by clicking on Use Relative References.
Running a Macro
After you record your macro, you should run it to test that it works correctly.
Note: Alternatively, you can run your macro by typing the keyboard shortcut, assuming you assigned
one to your macro.
Note: Unless you are comfortable with VBA code, you may find it easier to re-record a macro to make
enhancements or correct errors.