Question: Build these into your VBA code: Use IF statements in the coding: If a user clicks the button without selecting the Account Manager, the Message
Build these into your VBA code:
Use IF statements in the coding:
- If a user clicks the button without selecting the Account Manager, the Message Box (Msgbox) should display “Choose an Account Manager from the first combo box”; and stop executing the code (Use Exit Sub)
- If a user clicks the button without selecting the Product Category, the Message Box should display “Choose a Product Category from the second combo box” and stop executing the code. Make sure to declare two variables (one variable to save Account Manager’s name and another to save Product Category). Example: Dim AccountManager as String You will only need two lines of filtering code; one that filters on the Account Manager criteria and another line of code that filters on the Product Category criteria.
Do not create any more lines of code for these 2 criteria. Instead, make sure these two lines of filtering code dynamically filters on the Account Manager criteria and the Product Category criteria (Hint: Make a reference to the two variables you would have declared).
Once the data is filtered, a message box must display a message to the user. This message must include the Account Manager’s name and the Product Category on which the data is filtered.
Step by Step Solution
There are 3 Steps involved in it
Below Ill provide you with a stepbystep guide to creating this VBA code The code will ensure that the user selects an Account Manager and a Product Ca... View full answer
Get step-by-step solutions from verified subject matter experts
