Excel help - combin...
 

MegaSack DRAW - This year's winner is user - rgwb
We will be in touch

[Closed] Excel help - combining worksheets

7 Posts
7 Users
0 Reactions
97 Views
Posts: 1237
Free Member
Topic starter
 

I have around 200 worksheets in separate .xls files which all have the same column titles and I want to combine them into 1 Excel file and into 1 worksheet so I can use pivot table to analyse them. Is there a 'quick' way of doing this? Or what is the best way of doing this? My current method of opening them all and moving them into a new worksheet is very longwinded. Thanks


 
Posted : 25/06/2020 1:57 pm
Posts: 17268
Full Member
 

Import with SAS/R, combine and export for pivot table analysis in XL. Are the names similar to allow for recursive coding?


 
Posted : 25/06/2020 2:29 pm
Posts: 10854
Full Member
 

It's doable in VBA but if you don't know vba it'd be quicker to hand crank it - assume you can chuck them all in one folder then iterate through those and pull the data onto a single sheet, and that there won't be too many rows for a single sheet once you have combined them all?


 
Posted : 25/06/2020 2:37 pm
Posts: 77691
Free Member
 

Data / Get Data / From File / From Folder.


 
Posted : 25/06/2020 2:42 pm
Posts: 6332
Free Member
 

If the file names are all fairly similar then a VBA can loop through them one by one and copy and paste the data into the collated file.


 
Posted : 25/06/2020 3:19 pm
Posts: 6858
Free Member
 

Yeah you could write a script for it in Python / R / Matlab. It's the sort of thing I'd waste an hour doing when Cmd+A, Cmd+C, Alt-Tab, Cmd-V *200 could do it in about 10 minutes.


 
Posted : 25/06/2020 3:38 pm
Posts: 1237
Free Member
Topic starter
 

Thanks for the tips folks.


 
Posted : 30/06/2020 9:49 pm
Posts: 1781
Free Member
 

Power query add in would do this easily.


 
Posted : 01/07/2020 1:13 am