Question
The worksheet named Clients has a list of 10 clients (it can have more or fewer) with different quantities of products ordered. The program will
The worksheet named Clients has a list of 10 clients (it can have more or fewer) with different quantities of products ordered. The program will populate the columns to the right of the last column with data (including headers). For example, the Amount Before Extra Discount paid by the last client for Gadget1 is $9,311.20 (=1030*$9.04); that is, the amount in cell F14 (in this example) of the clients worksheet would be $9,311.20. The Total Amount in column J in the sum of the Amount Before Extra Discount over all products and depends on the quantities ordered as indicated in the worksheet Products. If, however, the Total Amount of purchase exceeds the if more than in the worksheet Products, ($25,000.00 indicated in cell G7 in this example) then the percent extra discount specified in the worksheet Products (cell G5 in this example) applies in addition to the discounts obtained by the quantity ordered of each gadget (i.e., in this example the 5% discount applies to each unit cost of the gadget bought by the customer). Note that the headers in this worksheet are pre-specified for the Clients, and the
product names but the headers for all other columns have to be appropriately generated and placed through VBA. That is, the cells populated by the program in all the worksheets should be cleaned out manually every time the program is run and before calculating the new values.
Using the data provided, the macro will calculate the "Amount Before Extra Discount" for each product, "Total Amount" before extra discount, "Amount After Discount (if any)" for each product, and "After Discount Total Amount" for each client in the worksheet "Clients". In the worksheet "Products" report the number for each product under the "Total Ordered" header, the "Total Amount" before the extra discount for each product and the "Total Amount (with extra discount)" for each product. (Hint: Initially use cell "A4" as anchor cell in the products worksheet and also in the Clients worksheet. Define range variables for the products and the price breaks and assign the number of products and the number of price breaks to variables. Assign to variables the extra discount percentage and the amount required for the extra discount. You may need to use nested For Next loops to loop through Clients, then through Gadgets and then through Price Breaks. The loop through Price Breaks may be easier to do going from the highest to the lowest order Nuantity for tha nrino hroak
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started