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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
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.
 
Upvote 0

Forum statistics

Threads
1,215,527
Messages
6,125,337
Members
449,218
Latest member
Excel Master

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
Back
Top