Answered step by step
Verified Expert Solution
Link Copied!

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!

image text in transcribed

image text in transcribed

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 days

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Cost Accounting

Authors: M.E. Thukaram Rao

3rd Edition

8122433820, 978-8122433821

More Books

Students also viewed these Accounting questions

Question

1. Make sure materials are easy to reach and visible to students.

Answered: 1 week ago

Question

=+ What characters could become part of everyday culture?

Answered: 1 week ago

Question

=+1. Work in teams of four or five.

Answered: 1 week ago

Question

=+5. Now write the same commercial as a 15-second spot. Think about

Answered: 1 week ago