To Activities
IT 121 -- Activity A12
Excel Macros
Turn in: An Excel File with your Macros.
Goal: Learn how to record, modify and run macros.
- Record a macro with name the FormatData and shortcut key Control-f. Enter
some data and format in any way you wish. You must include at least four
modifications, which can include:
- Enter numbers or text in cells.
- Change the font name.
- Change the font size.
- Change the font color.
- Set the font to bold, italic or underlined.
- Change the fill color of cells.
- Change the fill pattern of cells.
- Change the borders of cells, including the border line type and border
line color.
- Edit your macro. Make these modifications:
- Replace each property FormulaR1C1 by the more understandable property
Value.
- Make any other modifications that you wish.
- Test your FormatData macro:
- Set all the cells in the worksheet back to their default values.
- Run your macro by using the shortcut Control-f.
- Record another macro named UnformatAll:
- Set the shortcut key to Control-u.
- Select all cells that were formatted by the FormatData macro.
- Set to default values everything that was set by FormatData.
- Edit UnformatAll:
- Remove the first line that looks something like this:
- By removing this line, the macro acts on the selection that is chosen by
the user before running the macro.
- Test UnformatAll:
- Run the FormatData macro.
- Run the UnformatAll macro.
- Verify that everything has been set back to default settings.