Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help making this macro in VBA. Thanks! Complete this problem on Sheet2 of the provided Excel workbook. A restaurant sells four items: hamburgers,
I need help making this macro in VBA. Thanks!
Complete this problem on Sheet2 of the provided Excel workbook. A restaurant sells four items: hamburgers, french fries, milkshakes, and coffee. At the end of each day, the owner inputs the number of units sold during that day for each item on Sheet2. For example, 12 coffees were sold on May 3. 14 days of data is currently in Sheet2. The amount of profit per unit sold is listed in cells H6:H9. For example, the restaurant makes $2.00 profit for each milkshake sold. A B D F G 1 2 Day # Hamburgers French fries Milkshakes Coffees Use this sheet for Problem 2 3 May 1 35 25 4 10 4 May 2 41 28 8 15 5 May 3 31 18 11 12 Profit per item (dollars) 6 May 4 25 31 9 16 Hamburgers 1.25 7 May 5 22 28 9 9 French Fries 1.50 8 May 6 33 26 3 21 Milkshakes 2.00 9 May 7 30 23 12 17 Coffees 0.55 10 May 8 29 21 7 18 11 May 9 25 14 8 23 12 May 10 37 27 11 18 w Hamburgers? 426 13 May 11 36 19 10 16 Days? 12 14 May 12 33 16 15 18 Total profit? 1385.7 15 May 13 22 21 6 19 Most profitable item? Hamburgers 16 May 14 27 26 7 22 17 18 19 Problem 2 20 Create a run button on Sheet2 that executes a macro named problem2. This macro will answer the following questions: How many hamburgers were sold during the 14 days? Output this value to cell H12. How many days did the restaurant sell more hamburgers than fries? Output this value to cell H13. How much total profit did the restaurant make during the 14 days? Output this value to cell H14. What item made the greatest amount of profit during the 14 days? Output this value to cell H15. Do NOT use any of Excel's workbook functions, such as SUM or AVERAGE, for this problem. This program should work for any values input into B3:E16 and 16:H9. Use Option Explicit for this macro. Hints: O The number of loop iterations should be equal to the number of days. Complete this problem on Sheet2 of the provided Excel workbook. A restaurant sells four items: hamburgers, french fries, milkshakes, and coffee. At the end of each day, the owner inputs the number of units sold during that day for each item on Sheet2. For example, 12 coffees were sold on May 3. 14 days of data is currently in Sheet2. The amount of profit per unit sold is listed in cells H6:H9. For example, the restaurant makes $2.00 profit for each milkshake sold. A B D F G 1 2 Day # Hamburgers French fries Milkshakes Coffees Use this sheet for Problem 2 3 May 1 35 25 4 10 4 May 2 41 28 8 15 5 May 3 31 18 11 12 Profit per item (dollars) 6 May 4 25 31 9 16 Hamburgers 1.25 7 May 5 22 28 9 9 French Fries 1.50 8 May 6 33 26 3 21 Milkshakes 2.00 9 May 7 30 23 12 17 Coffees 0.55 10 May 8 29 21 7 18 11 May 9 25 14 8 23 12 May 10 37 27 11 18 w Hamburgers? 426 13 May 11 36 19 10 16 Days? 12 14 May 12 33 16 15 18 Total profit? 1385.7 15 May 13 22 21 6 19 Most profitable item? Hamburgers 16 May 14 27 26 7 22 17 18 19 Problem 2 20 Create a run button on Sheet2 that executes a macro named problem2. This macro will answer the following questions: How many hamburgers were sold during the 14 days? Output this value to cell H12. How many days did the restaurant sell more hamburgers than fries? Output this value to cell H13. How much total profit did the restaurant make during the 14 days? Output this value to cell H14. What item made the greatest amount of profit during the 14 days? Output this value to cell H15. Do NOT use any of Excel's workbook functions, such as SUM or AVERAGE, for this problem. This program should work for any values input into B3:E16 and 16:H9. Use Option Explicit for this macro. Hints: O The number of loop iterations should be equal to the number of daysStep 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