importing multiple text files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have several hundred text files that I'd like to import to access and have
them all appended to one table. I can very simply import one text file at a
time, but this is cumbersome and inefficient. Is there a way to import text
files that are housed in a directory/folder? Or any way to set up a macro
that will import more than one text file at a time?


Thank you.


michael munson
(e-mail address removed)
 
I have several hundred text files that I'd like to import to access and have
them all appended to one table. I can very simply import one text file at a
time, but this is cumbersome and inefficient. Is there a way to import text
files that are housed in a directory/folder? Or any way to set up a macro
that will import more than one text file at a time?

You can't (readily) do this in a Macro but it's quite possible in VBA.
There is a Dir() function in VBA which retrieves the filenames in a
directory, and a TransferText method which imports the files (with the
option of appending them to a table). Without knowing more about the
specifics of your situation I can't suggest exact code, but try the
online help in the VBA editor for those two features to see if that
gets you started.

John W. Vinson[MVP]
 
Back
Top