|
Excel Computer Lab- Macro Commands
| Objectives
| Learning Tasks | References |
Objectives & Outcomes
The objective of this exercise is to help you learn how to create macro
commands. You can use these commands to automate the repetitive tasks that you perform in Excel.
Basic macros are recorded and saved when you perform a given procedure the first
time, so they do not require programming skills. At the end of this
lab, you should be able to:
-
Record and save Excel macro commands.
-
Create buttons and assign each to a macro command.
NOTE: Before you start this lab,
check the macro command security settings in Excel. Refer to the instructions on
the web page, Adjust Excel's Macro
Command Security Settings.
| Top |
Learning Tasks
| Task |
Procedures - (Useful
Shortcut Keystrokes) |
| Record and save Excel macros. |
- Right click here and download the assigned Excel file to your your network
drive (or portable media).
- Open the file.
- Select the cell in the top left corner of the database.
- On the Excel menu bar, click on
ToolsÞMacroÞRecord
Macro.
- In the Record Macro dialog box:
-enter a name (Sort_LastName)
-select to store the macro in This Workbook
-add any description that you
believe is necessary
-click OK.
- After the dialog box closes, select the entire database:
-hold down the CTRL key, then press the →
key
-hold down the CTRL key, then press the →
key.
- On the menu bar, click on
DataÞSort.
- In the Sort dialog box:
-select Sort by, Last Name
-click OK.
- On the Excel menu bar, click on
ToolsÞMacroÞStop
Recording.
- Save your worksheet.
- Repeat steps 3-10, but prepare a
macro to sort by percentage.
|
|
|
| Create buttons and assign them to the
macros.


 |
- Right click on the Excel menu bar and select the Forms toolbar
in the dropdown list.
- Select the buttons icon (refer to the image to the left).
- Place the cursor in the upper left hand corner of the cell
immediately above the cell with the Last Name column heading .
- Hold down the left mouse button and drag it to the lower right
hand corner of that cell (refer to the image to the left).
- Release the mouse button.
- In the Assign Macro dialog box:
-select the Sort_LastName macro
-click on ok.
- Hold down the CTRL key, and left click on the button.
- Select the text inside the button, and type over the existing
text with a meaningful name.
- Click on the spreadsheet outside of the button.
- Save your worksheet.
- Repeat steps 2-10 for the sort by percentage macro.
|
| Top |
References
| Top |
|