In the Eller Systems workbook, you add a record using the built-in UserForm. You record macros to filter and extract data and to clear filter results.
[Student Learning Outcomes 8.1, 8.2, 8.3, 8.4, 8.5, 8.7]
File Needed: Eller-08.xlsx (Student data files are available in the Library of your SIMnet account.)
Completed Project File Name: [your initials] Excel 8-2.xlsm
Skills Covered in This Project
- Set macro security options.
- Display the Form button.
- Enter data in a built-in UserForm.
- Record VBA macros.
- Run macros.
- Assign macros to Button form controls.
- Review and print VBA macro code.
- Set macro security and display the Developer tab and the Form button.
- Select the Options command [File tab] and click Trust Center in the left pane.
- Click the Trust Center Settings button and choose Macro Settings in the left pane.
- Verify or select Disable VBA macros with notification and click OK.
- Click Customize Ribbon in the left pane and display the Developer tab.
- Click Quick Access Toolbar and confirm or select the Show Quick Access Toolbar box.
- Select All Commands from the Choose commands from list.
- Find and select Form… in the list and click Add.
- Click OK.
- Open the Eller-08.xlsx workbook from your student data files.
- Save the workbook as an Excel macro-enabled workbook.
- Choose Save As from the File tab and navigate to your folder.
- Type [your initials] Excel 8-2 as the file name.
- Choose Excel Macro-Enabled Workbook from the Save as type list.
- Click Save.
- Add records using a data form.
- Select cell A4 and click the Format as Table button [Home tab, Styles group].
- Format the existing data using White, Table Style Light 8.
- Click the Name Box arrow and choose Table1. This is the default table name, and it does not include the header row.
- Click the Form button on the Quick Access toolbar. The input form displays data for the first record.
- Click New in the data form to open a new entry form.
- Type the data for a new record as shown in Figure 8-46.
- Click Close to close the data form.
- Scroll as needed to see the new record.
- Click the Name Box arrow and choose Table1. The new row is included in the table.
- Click the Save button on the title bar to save the workbook with the new record.
- Record a macro to filter clients.
- Select cell A4.
- Verify that the Use Relative References button [Developer tab, Code group] is off.
- Click the Record Macro button [Developer tab, Code group].
- Type FilterData in the Macro name box.
- Do not use a shortcut key and store the macro in This Workbook.
- Click the Description box, type Filter for selected service, and click OK. All commands and selections to build an advanced filter are recorded.
- Click the Advanced button [Data tab, Sort & Filter group] and select the Copy to another location radio button.
- Click the Up arrow at the right of the List Range box. The arrow collapses the dialog box.
- Select cells A4:F52 and click the Down arrow to expand the dialog box. The range name Hours is substituted and includes the header row.
- Click the Criteria range box and select cell J8:J9.
- Click the Copy to box and select cells J12:L12 (Figure 8-47).
- Click OK to run the filter.
- Click the Stop Recording button to the right of the Ready indicator in the Status bar.
- Record a macro to clear filter results.
- Click the Record Macro button [Developer tab, Code group].
- Type ClearResults in the Macro name box.
- Do not use a shortcut key and store the macro in This Workbook.
- Click the Description box, type Clear filter, and click OK.
- Select cell J13, the first cell that displays filter results.
- Press F8 (FN+F8) to start Extend Selection mode.
- Press the right arrow two times.
- Press Ctrl and then press the down arrow once to highlight to the end of the filter results.
- Click the arrow on the Clear button [Home tab, Editing group] and select Clear All.
- Select cell A4.
- Click the Stop Recording button to the right of the Ready indicator in the Status bar.
- Assign macros to Button form controls.
- Click the Insert Controls button [Developer tab, Controls group] and choose the Button (Form Control) command in the Form Controls category.
- Click cell H4, assign the FilterData macro, click OK.
- Right-click the button and choose Edit Text.
- Delete the default caption and type Show Results as the label.
- Select cell I4 to deselect the control.
- Insert another Button form control in cell H7 and assign the ClearResults macro.
- Edit the caption to display Clear Results.
- Size and align controls.
- Right-click the Show Results button to select it.
- Press Ctrl and right-click the Clear Results button. Both buttons display selection handles.
- Click the Height box [Shape Format tab, Size group] and type 0.35 and press Enter. The controls are the same height.
- Click the Width box [Shape Format tab, Size group], type 1, and press Enter.
- Click the Align button [Shape Format tab, Arrange group] and select Align Left (Figure 8-48).
- Select cell A4.
- Run the macros.
- Click the combo box arrow and select Web Site Development. The combo box uses cell J5 as its linked cell. Cell J9 has an INDEX formula that displays the data in the linked cell (J5) which is hidden beneath the combo box.
- Click the Show Results button to run the macro.
- Add a bottom border to row 25 in the results and a right border to the Hours column (Figure 8-49).
- Review, edit, and print macro code in the Visual Basic Editor.
- Click the Macros button [Developer tab, Code group] and select Edit.
- Display the Code window if necessary [View menu]. The code for two macros should be contained in Module 1. (If your code is not in Module 1, complete the steps to print and then expand Module 2 to print the second macro.)
- Size the Code window to display your macros.
- Delete unnecessary code lines and comment lines. Depending on movement and other commands you may have included in your macro, you can remove lines as needed (Figure 8-50).
- After you edit the code, run the ClearResults macro again to test it.
- Select a different service and run the FilterData macro to test it.
- Return to the Visual Basic Editor and display your code.
- Click File in the menu and select Print.
- Verify or select the Current Module radio button.
- Verify or select the Code box (Figure 8-51).
- Click OK to send the document to the current printer or click Cancel if no printer is available.
- Click the Close button for the Visual Basic Editor and return to Excel.
- Run the cleaned macros.
- Run the ClearResults macro if necessary to remove data.
- Choose Accounting Installation in the combo box and click the Show Results button.
- Complete borders as needed (Figure 8-52).
- Save and close the workbook.
- Hide the Developer tab and remove the Form button from the Quick Access toolbar.
- Hide the Quick Access toolbar.
Do you need help with this assignment or any other? We got you! Place your order and leave the rest to our experts.
