Microsoft Excel 2003
Recording a Macro
Auto formatting a Worksheet
- In a New Worksheet click on the menus Tools | Macro | Record New Macro. When the Record Macro dialog box opens save the macro by assigning a name or using the given default. (Use an underscore between two words)
- Under the label Store macro in: choose the drop-down option This Workbook and then click on the OK button.
- Notice that a Marcro button has appeared on your screen. Clicking on this button will stop the automated recording of your actions.
- Select the range A1:G1. Click on the Merge & Center button located on the Formatting Toolbar. Change the font size to 14 Bold.
- Select the range A5:G9, and then click on the Bold button located on the Formatting Toolbar.
- Select the range C6:G6, and then click | Format cells. Select the index tab Number and then Accounting. Choose to Show 2 decimal places and the $ symbol.
- Select the range C7:G8. Right click | Format cells | Accounting | no $ sign but show 2 decimal places.
- Select the range C9:G9. Right click | Format cells | Accounting | show $ sign and 2 decimal places.
- Select cell A12 and then click on the Bold button.
- Select cell C12 and then click on the Bold button. Next, Right click | Format cells |Accounting | show $ sign and 2 decimal places. Click on the Stop Macro button. Save the worksheet.
- Finally undo Select the entire worksheet as we did in the beginning see Step 1. Under Edit | Clear | Formats. When the formatting is removed run the assigned macro under Tools.
Assigning a macro to enter your name and the current date
- Repeat the first two steps used in the prior example.
- Select cell A20 and then enter your name.
- In cell A21 type =NOW() and then press Enter.
- Click on the Stop Macro button to Save the worksheet.
Deleting Blank Rows
- Repeat the first two steps used in the two prior examples.

- Next, enter some date in a work sheet leaving blank rows between the data.
- Click on menus Tools | Macro | Record New Macro.
- From the Edit menu choose Go To and then click on the Special button. Check that the button states Blanks and then click on OK. The blank rows will now be selected.
- Click on the menu Edit | Delete and then choose Shift Cell Up, the blank rows are deleted. Please note that any merged cells are also deleted.
