Macros
Macro - series of instructions that are stored for later retrieval
- Creating/Recording a Macro
- Close any workbooks that may be open.
- Open a New Workbook.
- Turn on the Macro Recorder:
- Tools|Macro|Record New Macro
- Assign a name to your macro and select a Shortcut key; for example - UniversityName and U
- Notice that the word "Recording" appears in the Status bar and the Stop Recording button floats above the document window
- Press: CTRL+HOME
- Enter your data: New Mexico Highlands University | University Dr. | Las Vegas, NM 87701 <ENTER>
- Select cell range from A1 to A3;
- click the Bold button,
- click the italic button,
- select Times New Roman from the Font drop-down list,
- slect 12 from the Font Size drop-down list,
- Select cell A1 and select 14 from the Font Size drop-down list.
- To stop recording, click the STOP button.
- Playing Back/Using a Macro
- If you gave your macro a shortcut key, you can press it to run the macro
- Choose Tools|Macro|Macros|double-click your macro name
- Reviewing/Editing a Macro
- Choose Tools|Macro|Macros|Edit
- Edit the Visual BASIC code and close
To add a button for a macro
- Open the worksheet that you want to add the button to.
- Make sure the Forms toolbar is displayed
- On the Forms toolbar, click the button for the control you want
- ON the worksheet, drag the control to the size you want and rename the button.
- Select the macro you want to run when you click the button in the Macro name box