Copy data from one table to multiple table.

patapsychonaute

New Member
Joined
Mar 28, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello There.

so in short: populate data from one master table (with 'variable structure') to multiple tables.
in long:
I have one table: data_src. with column/headers like this: tbl1$col1 | tbl1$col2 | tbl1$col3 | tbl2$col1 | tbl3$col1 | tbl3$col4 | tbl5$col2 | tbl5$col7 | ... | tbl-nth$col-nth|
this data_src, as you may see has a variable structure (amount and name of column). lets say i have 3 of these data_src table.

Now, i have tb1, tb2, tb3, tb4, tb5, ... , tb-n, all with n-th column (n is different for each table).

i would like a VBA, power query, data model, relationship, or script to:
1)have a cursor that move through each header of the data_src1
2)select content of the header field, split it at the $, then use tbl-nth and col-nth as parameter to Go To tbl-nth col-nt (maybe located in an same or different workbook (all in one folder))
3)insert/copy data TO tbl-nth at col-nth FROM data_src1 tbl-nth$col-nth
4)move curso to next header/column of the data_src1. repeat 2) and 3)

operations above are repeated for data_src2,3 etc. data_src could have many columns. let's say they would come weekly or daily.

i could figure it out in sql, but i am a newbie to vba, srcipt, etc. Very happy for the support. thanks in advance.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,223,897
Messages
6,175,270
Members
452,628
Latest member
dd2

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