The ideal solution for this would be in VBA and not a formula because I need the first sheet to reset itself each time thus a formula would get overwritten.
I have two sheets:
Sheet1 (Subtract Inventory)
Item# Sold
1022 23
1024 56
1025 52
Sheet2 (Count)
Item# Count
1020 1027
1021 99
1022 76
1023 128
1024 57
1025 1023
1026 987
What I would like to do is have VBA code that will update Sheet2 by subtracting the “Sold” on Sheet1 from the “Count” on Sheet2. The result would look something like this:
Sheet2 (Count)
Item# Count
1020 1027
1021 99
1022 53
1023 128
1024 1
1025 971
1026 987
I have been able to figure out several codes but I can never get them to fit. And Sheet1 will have users paste info from a website so it will have to base the search on the Item number and not column A.
I think the best thing to do is a restart to make sure that I am not messing up by starting off in the wrong direction. Does anyone have any idea where to begin?
Another way using Vlookup
Hope this is what you are trying?
TRIED AND TESTED
SNAPSHOT
FOLLOWUP
The cleaning that you are doing at the moment is not correct. If I manually do the cleaning the sheet should look like this?
Also if you notice that then numbers are stored as text or have blank spaces. Vlookup will fail in these scenarios.
In such a case, I recommend the following
1) You need to have a macro in places which cleans your data more effectively for input
2) Either you move the “SKU” before the “QTY” and then use Vlookup OR use an alternate method.
3) If you are interested in an alternate method then see (Section 4) in this link
http://www.siddharthrout.com/2011/07/14/find-and-findnext-in-excel-vba/