Forum

Import multiple tab...
 
Notifications
Clear all

Import multiple tables from one folder to how many Excel worksheets?

9 Posts
5 Users
0 Reactions
88 Views
(@jaryszek)
Posts: 177
Reputable Member
Topic starter
 

Hi,

i haveto import at once a lot of entirely separated tables in PQ. What is the best approach to do and how to do this?:

 

1) Import all tables (about 50) to one worksheet on Excel and place them one by one in horizontal view (or one below another) - how to do this?

2) import all tables - every table to different specific worksheet? And how to do this in Power Query in one query ?

Please help,
Jacek Antek

 
Posted : 21/11/2020 11:05 am
Anders Sehlstedt
(@sehlsan)
Posts: 970
Prominent Member
 

Hello,

Do the tables have the same structure or are they each individual?

If they all have same structure you can use Power Query, where you load the files from a folder. See this article about that approach.
If they have different structure then it is easier to just copy and paste into one file.

Br,
Anders

 
Posted : 22/11/2020 1:17 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Jacek,

Are we talking about tables in Excel workbooks?  

As Anders said, you should use Get files from folder in Power Query.  What's the goal?  Do you want to merge these tables into fewer tables?

Regards

Phil

 
Posted : 22/11/2020 9:48 pm
(@jaryszek)
Posts: 177
Reputable Member
Topic starter
 

Hi,

thanks!

I do not want to merge tables and combine them. They are just different structure tables in CSVs...

And want to output them into multiple worksheets (or single one one next to another)

Best,
Jacek

 
Posted : 23/11/2020 6:42 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Jacek,

If it's 50 separate queries you want outputted, then you need 50 separate queries that you create one by one (after all, they all have different starting layouts that need converting), and I'd put them into their own sheet unless you can be sure they won't ever change shape/grow in future refreshes, in which case you can put them side by side in a single sheet. Either way, there are no shortcuts, sorry.

Mynda

 
Posted : 23/11/2020 7:16 pm
(@jaryszek)
Posts: 177
Reputable Member
Topic starter
 

Thank you very Much Mynda!

Jacek

 
Posted : 24/11/2020 1:58 am
(@jaryszek)
Posts: 177
Reputable Member
Topic starter
 

Hi,

i would like to refresh topic. 

I have chosen to use seperate sheet for each table.
It is possible to do this somehow automatically? 

I mean refresh folder source from PQ and use PQ M language or VBA to output each table to seperate folder? 

Best,
Jacek

 
Posted : 07/01/2021 5:47 am
(@catalinb)
Posts: 1937
Member Admin
 

The output destination is not controlled in M language, so there is no way to write in the query the destination sheet. (yet)
Only VBA can help...

 
Posted : 07/01/2021 10:40 am
(@catalinb)
Posts: 1937
Member Admin
 

The output destination is not controlled in M language, so there is no way to write in the query the destination sheet. (yet)
Only VBA can help...

 
Posted : 07/01/2021 10:40 am
Share: