Macro creation - Transfer spreadsheet command

Treeny

New Member
Joined
Sep 23, 2003
Messages
39
I'm using the 'Transfer Spreadsheet' command within a macro. The command imports data from an Excel spreadsheet. The data I require is not on the first sheet within the spreadsheet. It's in a sheet called 'Pre Term'. I'm trying to import from the 'Pre Term' sheet using the Range argument but cannot get the syttax correct. I'm typing:

Pre term!a1:e65536

in the Range argument but am getting an error message saying that the object Pre term cannot be found.

Where am I going wrong. I'm using Access 97 BTW.

Thanks in advance
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Is there definitely a space in the sheet name?

If so surround it with single quotes:

'Pre term'!a1:e65536

BTW do you really want to import all those rows?
 
Upvote 0
Thanks, I'll try that.

The amount of data I'm importing varies. It has been as high as 40,000 rows of data. I just use 65536 to ensure I capture everything. Blank rows don't appear to get imported anyway.
 
Upvote 0
Are you doing this import on a regular basis?

Why not create a link to the spreadsheet rather than importing it?

You could then use append queries if the data from the spreadsheet needs to be added to a table in Access.
 
Upvote 0

Forum statistics

Threads
1,221,829
Messages
6,162,232
Members
451,756
Latest member
tommyw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top