deadlyjack
New Member
- Joined
- Aug 21, 2021
- Messages
- 23
- Office Version
- 365
- 2019
- Platform
- Windows
I'd like to generate a function for a specific cell, where the amount increases or decreases, depending on what the user types into a specific cell - connected to two different buttons.
Once clicked a button, the cellvalue needs to add/subtract from the original value, mounted in a separate spreadsheet (In this case, my manual inventory sheet). I need this function to work so that my employees can add and subtract depending on what they need.
I got a dropdown list with 10 different items, taken from my manual inventory sheet. The cell below (B8) has a VLOOKUP, =VLOOKUP(B6;Inventory!A2:B11;2;FALSE)
VBA module for plus:
VBA module for minus:
How do proceed or what do I need to do in order to get a functional generator, which tells the user the current amount in cell B8?
Once clicked a button, the cellvalue needs to add/subtract from the original value, mounted in a separate spreadsheet (In this case, my manual inventory sheet). I need this function to work so that my employees can add and subtract depending on what they need.
I got a dropdown list with 10 different items, taken from my manual inventory sheet. The cell below (B8) has a VLOOKUP, =VLOOKUP(B6;Inventory!A2:B11;2;FALSE)
Kyl inventarie.xlsm | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | |||||||
2 | |||||||
3 | |||||||
4 | |||||||
5 | Sort | Amount | |||||
6 | Loop Mango Tango | 20 | |||||
7 | Amount in Storage | ||||||
8 | 60 | 40 | minus | ||||
9 | 80 | plus | |||||
10 | |||||||
11 | |||||||
12 | |||||||
Main |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B8 | B8 | =VLOOKUP(B6,Inventory!A2:B11,2,FALSE) |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
B6 | List | =Inventory!$A$2:$A$11 |
VBA module for plus:
VBA Code:
Public Sub InventoryCountPlus()
i = ("B8")
Range("D9").Select
Range("D9") = Range("B8") + Range("D6")
Range("D5").Select
ActiveCell.Offset(1, 0).Select
i = i + ("B8")
End Sub
VBA module for minus:
VBA Code:
Public Sub InventoryCountMinus()
i = ("B8")
Range("D8").Select
Range("D8") = Range("B8") - Range("D6")
Range("D5").Select
ActiveCell.Offset(1, 0).Select
i = i + ("B8")
End Sub
How do proceed or what do I need to do in order to get a functional generator, which tells the user the current amount in cell B8?