The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 2 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Need help completing this assignment attached. It is an Excel VBA assignment.
VBA HW4
Be sure to: Have Option Explicit at the beginning of the module.
Save your workbook as a macro enabled workbook.
Test your macro. PART 1)
You are to create a macro that will compute an updated inventory level which can be
positive or 0 (where 0 means some of the new orders were not satisfied due to
insufficient inventory). Name your macro such that it will be descriptive of what is
created for.
Declare a local variable of type integer for each of the values below: current inventory level
number of new customer orders You will need to declare other variables to fulfill the following steps:
1. Use two input boxes to get the current inventory level and the number of new
customer orders.
2. Find the new inventory level by subtracting the amount of new orders from the
current inventory level.
3. Use the Excel MAX function to get the larger of two numbers: the result of your
subtraction from step 2 and 0
Now, use a SINGLE MsgBox with the title “Inventory Status” to show the current inventory level the amount of new orders the new inventory level which is the result from the MAX function you used in
step 3.
Test your macro with several different values with some should have the number of new
orders larger than the current inventory level, and some smaller. See the two examples
given below: PART 2)
Have at least 3 sheets in your workbook, name/label one of them as Part2. Type in
Date, Current Inventory Level, New Customer Orders and New Inventory Level in the
cells A1:A4, respectively, of the sheet Part2.
Now you’re required to add more logic to the macro you created in Part 1.
Declare a variable named as dateOrder of type Date, and ask user to enter a date for it.
When you run the macro you have in Part 1, your macro should do the following in cells
B1:B4 of sheet Part2: put the input being entered for dateOrder in cell B1
put the input you received from the user for the current inventory and the new
customer orders in cells B2 and B3, respectively.
Put the new inventory level you found in step 3 in cell B4. Activate sheet Part2.
-----------