- Gain exposure to programmatically-accessible objects and events in MS Excel.
Create a new macro-enabled workbook named net_id
-excel-objects.xlsm, where net_id
is your university-issued net identifier (i.e. the first part of your university-issued email address).
Create two worksheets in the workbook: one named "Hello" and the other named "Interface". On the "Interface" sheet, create six command buttons, and revise their properties to reflect the following captions:
- "Read Workbook Name"
- "Read Worksheet Name"
- "Replay a Macro"
- "Read Contents of Cell A1"
- "Clear Contents of Cell A1"
- "Set Contents of Cell A1"
In the workbook, implement each of the following programming challenges using VBA code, and save the workbook after completing each.
Challenges related to code underlying "ThisWorkbook":
- When the user opens the workbook, activate the "Hello" worksheet, display a welcome message, then activate the "Interface" worksheet.
- When the user closes the workbook, display a goodbye message.
- When the user resizes the workbook, display a custom message.
Challenges related to code underlying the "Interface" sheet:
- When the user clicks the "Read Workbook Name" button, display a message containing the name of the workbook, whatever it may be.
- When the user clicks the "Read Worksheet Name" button, display a message containing the name of the worksheet, whatever it may be.
- Record and save a new macro of you performing a simple task such as formatting one or more cells. When the user clicks "Replay a Macro", execute that macro programmatically.
- When the user clicks the "Read Contents of Cell A1" button, display a message containing the contents of cell A1, whatever they may be.
- When the user clicks the "Clear Contents of Cell A1" button, clear the contents of cell A1.
- When the user clicks the "Set Contents of Cell A1" button, set the contents of cell A1 to be some text like "abc123".
Upload your workbook file to Canvas:
Submissions will be evaluated based on successful completion of component challenges:
Challenge | Weight |
---|---|
Workbook Open Event | 15% |
Workbook Close Event | 10% |
Workbook Resize Event | 10% |
Read Workbook Name | 10% |
Read Worksheet Name | 10% |
Replay Macro | 15% |
Read Cell Value | 10% |
Clear Cell Value | 10% |
Write Cell Value | 10% |
This rubric is tentative, and may be subject to slight adjustments during the grading process.