Import Multiple Text Files from a Folder using VBA

AGALLEGOS

New Member
Joined
Aug 26, 2013
Messages
10
What I would like to do is fairly straight forward, but I am having difficulty finding an answer that suits my needs. There have been replies to this question in other places, but they have not worked. So this is what I would like to do.

Background: I have built a spreadsheet that analyzes data that I routinely insert into excel via a copy/paste macro in word. But since this is a manual task, I can only insert one set of data at a time. I would like to import several .rpt files at once and modify my data analysis spreadsheet to analyze all of them at once....Instead of opening a word file, run the data select macro, open excel, paste it in ..and so on.:mad:

Ideally, I would like some VBA code that will

1. prompt me to select the .rpt files from a folder I wish to import.
-not from a coded directory. Something like a File>Open window.
2. The user will select multiple .rpt files from the folder
3. Import the .rpt files into a single worksheet named 'ANALYSIS' in different columns - preferably each file will be separated by one column of empty space (A..C..E..etc).
-I do not want any kind of delimiters, though. My spreadsheet is already coded to do this later.

Thanks a bunch. Any useful tips would be helpful, as this is the last piece of the puzzle I need for a truly awesome analysis spreadsheet.

--G.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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