Can a macro import multiple Excel worksheets

G

Guest

Can you build a macro to import multiple Excel Worksheets?
Is it thought the action TransferSpreadsheet?
And if so, what is the correct syntax to change from worksheets within the
File Name?
 
G

Guest

I do not know it in a macro but here is the code
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
"tablename", filename, True, "sheetname!"
 
G

Guest

Thanks that was helpful.

Would you happen to know if there is a way I can reference a range of
worksheets or do I need to reference each individually. So, for example, if I
have an Excel workbook that contained 3 different worksheets (sheet 1, sheet
2 and sheet 3 0 - how would I import all three (plus any other that may get
inserted between the existing ones)?

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
"tablename", filename, True, "sheet1!sheet3" ?????????????


THANKS!!
 

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