patapsychonaute
New Member
- Joined
- Mar 28, 2023
- Messages
- 1
- Office Version
- 365
- Platform
- 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.
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.