Importing from Excel with multiple sheets

miguel vasquez

Registered User.
Local time
Today, 18:54
Joined
Nov 11, 2002
Messages
36
I have a file in Excel and I need to export two sheets from excel to access for example sheet1 and sheet2. How can I do this using VBA? It's just importing the first sheet, I think I need to specify the sheet I want, but I don't know how to do it.

thanks
 
Look closely at the "Range" (last) action argument in a "transfer spreadsheet" action of a macro. Here is an example of how to grab a particular sheet.

Edited Data!A1:I1200

Once you create the macro, just right click on it and save it as a module if you want to execute it in VBA. You'll wind up with something like:

DoCmd.TransferSpreadsheet ......

Named ranges are probably easier than what I presented above.
 

Users who are viewing this thread

Back
Top Bottom