Insert rows with formulas based on a cell value

Heguli

New Member
Joined
Nov 8, 2019
Messages
1
Hey,

Please I need help in this case; thank you in advance!

I insert data and have the data in Table1 in Sheet1:
[TABLE="width: 500"]
<tbody>[TR]
[TD]A1 DATA
[/TD]
[TD]B1 Order[/TD]
[TD]=COUNTA(A2;A1000) (result: 2)[/TD]
[/TR]
[TR]
[TD]A2 Car 1[/TD]
[TD]B2 25[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A3 Car 2[/TD]
[TD]B3 45[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Every time I insert new data, new data might add/cut rows to/from this table. I count the amount of rows with COUNTA -> this scenario I have 2 rows.

I have another Table2 in Sheet2, which is linked to Table1 above.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Car 1[/TD]
[TD]Car 2[/TD]
[/TR]
[TR]
[TD]=formula1
linked to table above
[/TD]
[TD]=formula2 linked to table above[/TD]
[/TR]
[TR]
[TD]=formula1
linked to table above
[/TD]
[TD]=formula2
linked to table above
[/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>
I would like to be able to just insert the automatic SAP data to Table1, which adds rows to A and B column. I calculate the amount of rows with COUNTA.
I would like Excel to automatically insert as many rows as COUNTA cell gives to this Table2 and automatically copy the formulas to those rows -> this example those formula1 and formula2 rows would be automatically created. Currently I have to manually extend Table2 rows with formulas in order to cover all rows from Table1.

How could be this done with VBA?

Thanks!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

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