Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / October 2004

Tip: Looking for answers? Try searching our database.

Importing ranges from a tab within a workbook

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
- 04 Oct 2004 22:44 GMT
Hello All,

I am using a macro to import a spreadsheet into a table
(see macro below).  The macro works well to import the
whole sheet when there is only that sheet in the
workbook.  However, I need to specify certain ranges on a
particular tab within a workbook.  For example, I only
want to import ranges (A3:AA10, A12:AA261) from the Budget
Input tab and the workbook has a few other sheets.  Any
ideas?  

DoCmd.TransferSpreadsheet acImport, 8, "ImportedSS",
strDirName & strWorkbookName, True, ""

Thanks,
Dion
George Nicholson - 04 Oct 2004 23:45 GMT
Try replacing "" (the Range argument) with "BudgetInput!A3:AA261"
I've never tried importing a specific (unnamed) range, but I do know that
"BudgetInput!" (including the all-important exclamation point) would import
the BudgetInput sheet in its entirety.

Having said that, I suspect, but do not know for a fact, that importing a
non-contiguous range may not be supported. What I normally do is import a
whole sheet of data into an empty shell temp table and then run an append
query to move only the data I wanted from temp to "Live" (converting values
as necessary). I find it makes the whole process a bit more flexible and
robust: if the structure changes in either Excel or Access it can often be
either ignored or handled by editing the query rather than code.

Getting it into Access is one step. Putting it to bed and tucking it in is
usually another.
Signature

George Nicholson

Remove 'Junk' from return address.

> Hello All,
>
[quoted text clipped - 12 lines]
> Thanks,
> Dion
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.