I am trying to create an inventory sheet that has buttons to subtract a specified quantity from a stock quantity. There are different "builds" that require different inventory items, and I would like to be able to subtract the amount of inventory from the stock quantity for the specified build (See below):
[Part #] [Description] [Stock Qty] [Build 1] [Build 2]
1 _______ Screw _______ 20 _______ 2 ______ 1
2 _______ Bolt ________ 20 ________ 1
3 _______ Pipe ________ 10 _________________ 2
So if I performed Build 1, there would be 18 screws, 19 bolts, and 10 pipes left. If I performed build 2 (from the same starting quantity), there would be 19 screws, 20 bolts, and 8 pipes. I have written out code for each item individually by referencing the exact cell using the following code:
The only problem is that there are over 100 inventory items on my spreadsheet and each time I change the location of something, I have to go in and update every cell reference (there are 6 "builds", so this is a lot). I am thinking there would be a way to loop through checking to see if there is anything in the "build" columns (D,E above) and somehow index that row to specify the correct stock quantity cell, but I'm a noob with VBA and can't seem to get anything to work.
Thanks in advance for any guidance!
Bookmarks