andydtaylor
Active Member
- Joined
- Feb 15, 2007
- Messages
- 360
- Office Version
- 2016
Hi,
I've been scratching my head on a problem which I can't figure out a nice solution to. I hope an expert can give me a steer on the steps I should take!
I have a main parent model file which needs to import data from child models. The folder containing the input modules is on the same path as the main model:
main model
/input_modules/
---loans.xlsm
---tb.xlsm
---PR.xlsm
---[future files]
Each input module (child model) contains a table called o_Export on a sheet called o_Export. The columns contain some commonality (e.g. Date, Amount, Description) and some columns unique to the particular input module. Below is a screen grab of how I have the control laid out at the moment in the main model.
https://drive.google.com/open?id=1-czgh5H4KNlolfpM0yuQ3ap_75DL4Hjl
I want to implement either of the below possibilities:
Option 1: Combine each "o_Export" tables found in each excel file in that input_modules folder
Option 2: Specifically import the o_Export table from each input module file name as specified in my main model control sheet
Or Option 3 something equivalent I haven't thought of.
I've gone in circles for a few hours and I'm getting a bit perplexed by functions and parameters and single queries versus separate queries and I'm not sure how to make this work. But I feel there must be a way! Clearly there needs to be some kind of control to prevent errors - with Option 2 for example I need to dismiss input modules without a file name and not try to import these. A key capability I want to incorporate is the ability to add a new input module(child model) which contains an o_Export table and have this consolidated by the main model. I'm happy for there to be a need to specify the file name in the main model controls.
I look forward to some advice! I'm quite familiar with much of Excel and vba but confess I have not read much on Power Query or M so I am still learning by doing.
Many thanks,
Andy
I've been scratching my head on a problem which I can't figure out a nice solution to. I hope an expert can give me a steer on the steps I should take!
I have a main parent model file which needs to import data from child models. The folder containing the input modules is on the same path as the main model:
main model
/input_modules/
---loans.xlsm
---tb.xlsm
---PR.xlsm
---[future files]
Each input module (child model) contains a table called o_Export on a sheet called o_Export. The columns contain some commonality (e.g. Date, Amount, Description) and some columns unique to the particular input module. Below is a screen grab of how I have the control laid out at the moment in the main model.
https://drive.google.com/open?id=1-czgh5H4KNlolfpM0yuQ3ap_75DL4Hjl
I want to implement either of the below possibilities:
Option 1: Combine each "o_Export" tables found in each excel file in that input_modules folder
Option 2: Specifically import the o_Export table from each input module file name as specified in my main model control sheet
Or Option 3 something equivalent I haven't thought of.
I've gone in circles for a few hours and I'm getting a bit perplexed by functions and parameters and single queries versus separate queries and I'm not sure how to make this work. But I feel there must be a way! Clearly there needs to be some kind of control to prevent errors - with Option 2 for example I need to dismiss input modules without a file name and not try to import these. A key capability I want to incorporate is the ability to add a new input module(child model) which contains an o_Export table and have this consolidated by the main model. I'm happy for there to be a need to specify the file name in the main model controls.
I look forward to some advice! I'm quite familiar with much of Excel and vba but confess I have not read much on Power Query or M so I am still learning by doing.
Many thanks,
Andy
Last edited: