Importing mulitple worksheets

  • Thread starter Thread starter griffin13
  • Start date Start date
G

griffin13

I know the topic of importing Excel spreadsheets into Access has been
covered in this group but I was wondering if anybody can help me with a
spreadsheet I'm trying to import. I plan on using the
Docmd.transferspreadsheet command, but I need to figure out a few things.


1.)I'm trying to import several sheets from one Excel file into a table in
Access. I can do one sheet but when I try to do more than one it just keeps
looping the 1st sheet.

2.) There is a different Company Name located in cell A1 of 10 sheets that I
need to import to a specific field in Access.

3.) Some of the column headings don't match. For example one sheet has Names
and the other has Alias but they both need to be imported into the Person
field in my table.

I've seen bits and pieces of VBA code on the internet, but I haven't found
what I'm looking for. If someone can point me to a good website, book or can
write out what I need to do I would appreciate it.
 
When importing data, it's almost always best to import the data to a
temporary table, and then use append queries to copy the data to the correct
fields in the permanent tables.

There is a Range argument for the DoCmd.TransferSpreadsheet method. Use it
to provide the sheet name to be imported:
"WorksheetName!"
 
Back
Top