Need Code to import multiple files into two tables

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.
 
P

Piet Linden

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.
 
P

Piet Linden

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.
 
P

pnw1975

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)
 
P

pnw1975

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top