Importing multiple data files

Beawulf

New Member
Joined
Aug 16, 2013
Messages
1
Hi all,
I've got 170 csv files that I'm looking to compile into excel so as to analyse them, but am hoping to avoid having to do that one by one, adding each as a seperate tab.

Does anyone have any ideas of how I could do this, e.g. a macro or script, or if there's an "add all as tabs" add-in or something? Is excel my best bet here?

Thanks!
Beawulf
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

FrankSmith

New Member
Joined
May 17, 2013
Messages
16
Hi all,
I've got 170 csv files that I'm looking to compile into excel so as to analyse them, but am hoping to avoid having to do that one by one, adding each as a seperate tab.

Does anyone have any ideas of how I could do this, e.g. a macro or script, or if there's an "add all as tabs" add-in or something? Is excel my best bet here?

Thanks!
Beawulf
I usually cheat with importing data files like this; I use the Record Macro button, import the file the way I want it, and then Stop Recording. That will give you the base code to import everything exactly how you want it, and then you can do more fancy things with the VBA it generates like use loops to determine the file name and what sheet it gets saved to. (There's probably a cleaner way of doing this, but this I feel is much faster). If your files are named properly (file1.txt, file2.txt, ... file100.txt), you could very easily use a For loop to construct the file path / name of the next report and create a new sheet to import to for it.
 

Forum statistics

Threads
1,141,058
Messages
5,704,032
Members
421,323
Latest member
Exidous

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
Top