Need Code to import multiple files into two tables

  • Thread starter Thread starter pnw1975
  • Start date Start date
P

pnw1975

I have 62 files that I need to automate the importing of. The file names will
change each time but the folder will stay the same. The first 31 files will
go into one table and the next 31 will go into the second table. They are
..txt files, and the first characters of the name will always be the same but
the end characters will change.
 
I have 62 files that I need to automate the importing of. The file names will
change each time but the folder will stay the same. The first 31 files will
go into one table and the next 31 will go into the second table. They are
.txt files, and the first characters of the name will always be the same but
the end characters will change.

You could have saved yourself a lot of trouble by actually searching
the archive...

http://groups.google.com/group/micr...a162b843757b1f?lnk=gst&q=DIR#91a162b843757b1f

Joe Fallon posted code that does this... it's been here for only a few
years...

Okay, so inside the loop, increment your counter variable. If you've
hit 31, change the table you're appending to... If you've created an
import spec for each of the two tables, just change the spec in the
second instance.
 
I have 62 files that I need to automate the importing of. The file names will
change each time but the folder will stay the same. The first 31 files will
go into one table and the next 31 will go into the second table. They are
.txt files, and the first characters of the name will always be the same but
the end characters will change.

You could have saved yourself a lot of trouble by actually searching
the archive...

http://groups.google.com/group/micr...a162b843757b1f?lnk=gst&q=DIR#91a162b843757b1f

Joe Fallon posted code that does this... it's been here for only a few
years...

Okay, so inside the loop, increment your counter variable. If you've
hit 31, change the table you're appending to... If you've created an
import spec for each of the two tables, just change the spec in the
second instance.
 
Thanks for the reply, I actually did search the archives on the OfficeOnline
website and nothing quites answered my question. So thank you for pointing me
to an answer on a different forum (i.e. google groups)
 
Thanks for the reply, I actually did search the archives on the OfficeOnline
website and nothing quites answered my question. So thank you for pointing me
to an answer on a different forum (i.e. google groups)
 
Back
Top