In this project, you build a macros-only workbook and run the macros in a separate workbook.
File Needed: PerfectRentals-08NoMacros.xlsx
Completed Project File Names: [your initials] PP E8-3Macros.xlsm and [your initials] PP E8-3.xlsx
- Create a new macro-enabled workbook.
- Create a new workbook and choose Save As from the File tab.
- Select This PC and type [your initials] PP E8-3Macros as the file name.
- Choose Excel Macro-Enabled Workbook from the Save as type list.
- Navigate to your folder for saving files and click Save.
- Display the Developer tab if it is not shown.
- Set macro security to Disable VBA macros with notification in the Trust Center.
- Record a macro with absolute references.
- Verify that the Use Relative References button is not active [Developer tab, Code group].
- Click the Record Macro button [Developer tab, Code group].
- Type InsertDate in the Macro name box.
- Click the Shortcut key box, press Shift, and type d.
- Verify that This Workbook is selected in the Store macro in box.
- Click the Description box, type Insert date statement, and click OK.
- Select cell F2. This is the first step in your macro.
- Use a nested CONCAT function in the macro.
- Click the Text button [Formulas tab, Function Library group] and choose CONCAT.
- Type Today is and press the Spacebar for the Text1 argument.
- Click the Text2 argument box. You will nest the TEXT function here.
- Click the Name Box arrow and choose More Functions.
- Navigate and find TEXT in the Text category.
- Verify that the Value argument box is ready in the TEXT Function Arguments dialog box.
- Type today() as the Value argument. You do not need an equals sign when the function is used as an argument.
- Click the Format_text argument box and type “mmmm dd, yyyy” including the quotation marks (Figure 8-34).
- Click CONCAT in the Formula bar and then click OK.
- Click the Stop Recording button [Developer tab, Code group].
- Test the macro.
- Click the Undo button to delete the statement. You can undo actions that were carried out as you recorded a macro.
- Press Ctrl+Shift+D to test the macro.
- Select cell F2 and delete the contents. You cannot undo actions that were carried out by execution of a macro.
- If your macro did not execute properly, open the Macro dialog box, delete it, and repeat steps 3–5.
- Determine macro steps to add fill to a row.
- Open PerfectRentals-08NoMacros.xlsx from your student data files.
- Select cell A5. You are not recording the macro at this point; you are going through the task to familiarize yourself with what you will record.
- Press Shift + press right arrow three times to select cells A5:D5.
- Click the Fill Color arrow [Home tab, Font group] and choose White, Background 1, Darker 15% (first column) to apply the fill color.
- Press Home and then press down arrow two times to move the active cell to cell A7. These are the steps to record in your macro.
- Click the Undo button and select cell A5.
- Leave the workbook open.
- Record a macro with relative references.
- Return to [your initials] PP E8-3Macros, your macros-only workbook.
- Select cell A1. You can record the macro from any cell.
- Click the Use Relative References button [Developer tab, Code group].
- Click the Record Macro button [Developer tab, Code group].
- Type ApplyFill in the Macro name box.
- Click the Shortcut key box, press Shift, and type f.
- Verify that This Workbook is selected in the Store macro in box.
- Click the Description box, type Apply fill color to current row, and click OK. All keyboard movement commands will be recorded.
- Press Shift + press right arrow three times. This selects cells A1:D1.
- Click the Fill Color arrow [Home tab, Font group] and choose White, Background 1, Darker 15% (first column).
- Press Home and then press down arrow two times. The pointer ends in cell A3.
- Click the Stop Recording button [Developer tab, Code group].
- Click the Use Relative References button [Developer tab, Code group] to turn off the command.
- Test the macro.
- Click the Undo button to remove the fill color.
- Select cell A5.
- Press Ctrl+Shift+F to test the macro. The macro runs in the current row.
- Apply No Fill to the cells in row 5.
- Open the Macro dialog box if your macro did not execute properly, delete it, and repeat step 8.
- Prepare documentation for the macros-only workbook.
- Click the Select All button to the left of the column A heading. This selects every worksheet cell.
- Apply Gold, Accent 4, Lighter 60% fill (eighth column).
- Select cell A1.
- Type the documentation as shown in Figure 8-35.
- Set the label in cell A1 to 16 pt, center the labels in row 3 and apply bold, and add borders as shown.
- Click Save on the title bar.
- Run macros in another workbook.
- Return to PerfectRentals-08NoMacros.
- Save this workbook as a regular Excel workbook named [your initials] PP E8-3 in your usual folder.
- Select cell A4.
- Press Ctrl+Shift+D to run the date macro. It displays the date in cell F2 because it was recorded with absolute references.
- Select cell A5.
- Press Ctrl+Shift+F to run the macro. The macro runs from the insertion point position.
- Press Ctrl+Shift+F to run the macro in row 7.
- Run the macro in the odd-numbered rows with data.
- Save and close the workbook (Figure 8-36).
- Save and close the macros-only workbook.
- Hide the Developer tab.
Do you need help with this assignment or any other? We got you! Place your order and leave the rest to our experts.
