<cell value> = number of rows to display after a given row, then copy row down <cell value> times

nadia p

New Member
Joined
Jul 16, 2019
Messages
8
I'm trying to create a dynamic form where by information is pulled from another worksheet and displayed in a master report. I have a cell that contains the number of transactions found based on FROM and TO dates (i.e. 3 transactions found between these dates).

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]From
[/TD]
[TD]01/01/19
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]To
[/TD]
[TD]01/31/19
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Transactions
[/TD]
[TD]3
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Date
[/TD]
[TD]Description
[/TD]
[TD]Qty.
[/TD]
[TD]Cost
[/TD]
[/TR]
[TR]
[TD]z1
[/TD]
[TD]z2
[/TD]
[TD]z3
[/TD]
[TD]z4
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Subtotal
[/TD]
[TD]$
[/TD]
[/TR]
</tbody>[/TABLE]

The row where z1, z2, z3, z4 reside I need to first copy this row below 2 more times, then copy the formulas from z1, z2, z3, z4 down as well to replicate the 10 transactions of data being pulled from the other worksheet.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]From
[/TD]
[TD]01/01/19
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]To
[/TD]
[TD]01/31/19
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Transactions
[/TD]
[TD]3
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Date
[/TD]
[TD]Description
[/TD]
[TD]Qty.
[/TD]
[TD]Cost
[/TD]
[/TR]
[TR]
[TD]z1.a
[/TD]
[TD]z2.a
[/TD]
[TD]z3.a
[/TD]
[TD]z4.a
[/TD]
[/TR]
[TR]
[TD]z1.b
[/TD]
[TD]z2.b
[/TD]
[TD]z3.b
[/TD]
[TD]z4.b
[/TD]
[/TR]
[TR]
[TD]z1.c
[/TD]
[TD]z2.c
[/TD]
[TD]z3.c
[/TD]
[TD]z4.c
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]Subtotal
[/TD]
[TD]$
[/TD]
[/TR]
</tbody>[/TABLE]

Later the user can modify the FROM / TO dates and it will look up the number of transactions so the "displayed rows" needs to update dynamically to the new value (i.e. 5).

I haven't figured out how to do this without braking the information (array) in the z* cells.

Any ideas?
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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