Hi!! Thanks in advance for any help!! For reference, I am using Excel 2013 on Windows 10.
I'm trying to write a macro that inserts X amount of rows that populate with data from a matching set of rows on another sheet, with X being dynamically tied to the results of another reference cell. For example:
If I enter K123 into cell B2, that will cause (based on an existing index/match formula) the value in cell G2 to change to "8". The macro will then add 8 rows (based on that resulting value in cell D10) which will fill with info based on matching the value in B2 to a set of data in another sheet.
Likewise, if a code I enter into B3 results in a value of "3" in G3, the macro will add 3 rows which will fill with info based on matching the code in B3 to a set of data in another sheet.
Illustrations of what I mean:
On the main sheet, I would enter a quantity and code into column A & B. Each time I do, a result will populate in column G based on an existing index/match formula that tells me how many components that item has.
Excel_Example1.png
After entering K123 in B2, the macro should insert 8 rows based on the 8 that resulted in G2, and that data will fill from another worksheet as illustrated in the image after this one. Then, if I next enter K987 into B11, the macro will insert 3 rows based on the 3 that resulted in G11, that data also filling in from the same worksheet referenced after this image:
Excel_Example2.png
Reference worksheet:
Excel_Example3.png
Bookmarks