Automatically add & delete rows in Table B based on data in Table A

distressednewbie

New Member
Joined
Jun 23, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Good day, fellow Excel experts. I'm in need of some help.

Below are two sheets in the same workbook, Experiment List and Iteration Times. I would like to make it so that when I add or delete a row in the first table, it should dynamically reflect onto the second table automatically.

If you are familiar with SQL, the first table's primary key is Experiment ID, which is the foreign key of the second table.

The user should not need to manually add or delete rows on the second table. It should adjust its rows dynamically based on Experiment ID in the first table.

Important Note: I do not have an issue making the Experiment ID in the second table take reference from the first table (I did this with a simple ='Experiement List'!B15). Although, if you have a better approach it would be much appreciated. I am struggling with the automatic adding and deleting of rows in the second table, based on actions done in the first table.

First table's name: Table_Main
Second table's name: Table_Iterations


A.jpg
B.jpg
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
If you convert the Iteration table to a normal range you can use
Excel Formula:
=Table_Main[Experiment ID]
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,180
Members
452,615
Latest member
bogeys2birdies

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