Macros are a very useful tool in Microsoft Excel. If you have a spreadsheet in which you perform the same set of functions repeatedly, a macro is the perfect way to consolidate several tasks into one simple mouse click. A macro will record any sequence of commands. You can then save the macro and play it back at any time to perform that same sequence. This is useful when the information changes frequently, but you routinely need to run the same calculations on it, or if you want to quickly format a cell with a specific size, font and colors all in one action.
Things You'll Need
- Microsoft Excel
- Spreadsheet populated with data
Building a Macro
Select the cell in which you will begin your commands. Before you begin you should have an idea of several actions that need to be performed in a specific sequence for your macro.
Go to "Tools," "'Macro," and select "Create New Macro."
Choose a name and shortcut for your macro. This will determine how you find and use it. Selecting a shortcut key can make using your macro even easier. Note that if you enter "A" as your shortcut key you will need to press Ctrl+Shift+A to activate the macro, whereas entering "A" will require you to press only Ctrl+A.
Begin recording your macro. Every action you take will now be recorded as part of your macro. You may want your macro to format cells a certain way, copy and paste or perform calculations. Perform these actions carefully and in the correct sequence.
Stop recording. When you are finished, click the stop button in the macro window.
Running Your Macro
Select the cell on which you want to run your macro.
Click on the "Tools: menu, then select "Macro" and "Macros."
Select the name of your macro from the drop down list, and click "Run."
Tips & Warnings
- There are several way to run a macro, other than the basic way listed above. You can also use your shortcut, providing you assigned one, or create a toolbar button and assign your macro to it.
- If you are new to creating macros, it may be helpful to play around and create a few simple ones that perform actions such as highlighting a cell. This should help you get the hang of the process.
- Avoid performing any unnecessary actions while recording a macro. If you click on another cell accidentally, this action is still recorded and will be repeated every time the macro is run.