Transferspreadsheet Range

J

Jeefgeorge

The DoCmd.TransferSpreadsheet range should accept non-adjacent cell references.

i.e. Range = Sheet1$B9:Sheet1$C9,Sheet1$D3
Returns Cells: B9,C9,D3

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...4d53&dg=microsoft.public.access.modulesdaovba
 
J

Jeefgeorge

This works when you have control over the source workbook, and when the cell
references are simple....my original references i would like to import are:


ColNum = 72 'Start at Column H
RowNum = 9 'Start at Row 9
Do While ColNum < 91 'Stop at Column Z
ColLet = Chr (ColNum)
Do While While RowNum < 259 'Stop at Row 258
Range = "Bidtab$B" & RowNum & ",Bidtab$D3:Bidtab$D5,Bidtab$" &
ColLet & RowNum
DoCmd.TransferSpreadsheet acImport, 8, Table, Path, False, Range
RowNum = RowNum + 1
Loop
ColNum = ColNum +2
Loop


This is much faster to code than to re-arrange and entire workbook to select
specific cells
 

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