How to Create a Macro in Excel 2007

By Ty Arthur

Excel 2007 includes extra features for working with the data in your spreadsheets, such as adding together values or counting the number of cells in a range. Macros are a prerecorded set of instructions that automate any series of operations in Excel. Creating a macro allows you to save time by automating repetitive tasks that you need to complete on a regular basis. Making a new macro only takes a few quick clicks.

Step 1

Open Excel 2007 and click the "Developer" tab at the top-right end of the window. Click the "Record Macro" button at the top of the "Code" heading.

Step 2

Type a name for the new macro in the "Name" text box, such as "Adding Columns" or "My New Macro." Type a key in the "Shortcut Key" text box if you want to map a shortcut to the new macro. Pressing the "Ctrl" key and the key you specify will automatically run the new macro.

Step 3

Type a brief description of what the macro is intended to accomplish in the "Description" box if you think other users may potentially need your macro. Click "OK" to begin recording the new macro.

Step 4

Perform the specific operations you want recorded in the macro, such as adding together the values in columns, creating new rows or calculating the average of two cells.

Step 5

Click "Stop Recording" when you are done performing operations. Click the "Macros" button when you need to run the macro. Click the macro's name and then choose "Run."

Tips & Warnings

  • The "Developer" tab may not already be turned on. Click the Microsoft Office icon at the upper-left corner of the window if the tab isn't visible. Click "Excel Options" and "Popular." Click the check box labeled "Show Developer tab in the Ribbon" and choose "OK."
  • Macros don't have to be recorded directly. If you are familiar with the VBA coding language, it is possible to create a macro entirely from scratch. Click the "Developer" tab and then click "Visual Basic" to bring up the Visual Basic for Applications editor screen.
  • By default, Excel 2007 will automatically disable any macros you attempt to run as a security feature. Navigate to the "Developer" tab and click "Macro Security." Select the "Enable all Macros" radio button and click "OK" to allow macros to run.
  • Assigning a shortcut key will override any other shortcut that is already using that key combination.