Hello -
I'm looking for a solution to expedite some data entry needed for a large inventory project. I am able to create Transfer Orders between locations in my company from .txt batch files. My buy sheet shows current overstock in all locations. I would like to write a macro to look at the value needed and insert lines in a worksheet that pulls from overstock values until the needed value is reached.

Example:
Location 01 needs 50 pcs of part # abc - inventory in other branches are as follows: 02: 10 pcs, 03: 4 pcs, 04: 30 pcs, 05: 6 pcs

The macro should insert the following lines on a new worksheet:
Location Part # Qty
02 abc 10
03 abc 4
04 abc 30
04 abc 6

This macro will run for 800+ lines at a time.
I've attached a small example -
In the attached sheet, Column G is the value needed - qtys can be pulled from columns N thru S

Thanks in advance for any help.
Example.xlsx