How to Update cells with the difference between cells in that column and another column

texexcel

New Member
Joined
Apr 24, 2016
Messages
2
I am trying to manage a list of inventory items using Excel 2016. I have three end products, each with its own Bill of Materials, and I have the relevant information all on one worksheet (Inventory Part, current inventory quantity, and quantity of said part in each of the 3 BOMs).

Say I am trying to create a build of Product 1. I want to click a button that will run through the column of parts used to assemble Product 1, subtract each quantity of each part from the corresponding inventory quantity, and replace the current inventory quantity with this difference to reflect the new inventory quantity.

I initially tried writing a VBA script to accomplish this but have been having difficulty with the syntax and getting it to replace the value of a cell with a new formula. I do not know how to specify the selection of cells that I am targeting. I am new to VBA and coding using Excel macros, so I do not know whether trying to record a macro to do this would be easier. Any help is very much appreciated!
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,214,585
Messages
6,120,391
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top