-
Step 1
Blank WorkbookOpen Microsoft Excel 2007.
-
Step 2
Developer TabClick the "Developer" tab.
-
Step 3
Recoed MacroClick the "Record Macros" selection in the "Code" section. A "Record Macro" window will open. Under "Macro Name" type "TestMacro1." Macro names cannot contain spaces. Leave the rest of the information blank for this exercise. Click the "OK" button. Every keystroke will now be recorded into your macro. We are going to create a very simple macro as an example.
-
Step 4
Numbers AddedPlace the following numbers (1, 2, 3, and 4) into cells A1, A2, A3 and A4, respectively. Click the "Stop Recording" selection. You have created your first macro. We have now decided that we want these particular numbers to be shown as currency values.
-
Step 1
Cells HighlightedClick the "Record Macros" selection and name this macro "TestMacro2." Click the "OK" button to start the recording. Highlight cells A1 through A4.
-
Step 2
Format Cells...Right-click the selected cells and select "Format cells..."
-
Step 3
Format Cells to CurrencyChange the Category to "Currency." Click the "OK" button.
-
Step 4
Stop RecordingClick the "Stop Recording" selection. Now we want to add the values together.
-
Step 1
Select cell A6Click the "Record Macros" selection and name this macro "TestMacro3." Click the "OK" button to start the recording. Select cell A6.
-
Step 2
Add mathematical functionType the following into the A6 cell: =A1+A2+A3+A4
-
Step 3
Stop RecordingPress the "Enter" key. Click the "Stop Recording" selection.
-
Step 1
Click to Sheet2Change the sheet selection to "Sheet2." Click the "Macros" icon. The "Macro" window will open.
-
Step 2
Run Macro windowSelect "TestMacro1" and press the "Run" button. You will see that your numbers have appeared on the sheet. Do the same for the other two macros you have created.
-
Step 3
Notice that the final version is an exact duplicate of what you created on "Sheet1." These three macros have showed you how to copy text, format cells and how to perform mathematical functions.












