J
Jeefgeorge
I am trying to import a non-adjacent range of values. using a do loop and the
transferspreadsheet command. I am able to select the correct range, but I get
a runtime Error 3011 - could not find 'B9,D3,D4,D5,H9'
The table being populated has fields [StdNo], [ProjNo], [CIP], [LetDate],
[UnitCost], where [StdNo] is in cells B9:B##, and [UnitCost] is in cells
H9:H##. The [ProjNo] - D3, [CIP] - D4, and [LetDate] - D5 are only shown in
the 'header' of the spreadsheet, but this data needs to be attached to each
unit cost entered into the table (UnitCosts are entered from all projects,
and calculations are made based on the let date).
CODE:
Dim Path, Range As String, Row As Integer
Path = "P:\Projects - Current\ProjBook.xls"
Do
Row = 9
Range = "B" & Row & ",D3,D4,D5,H" & Row
DoCmd.TransferSpreadsheet acImport, 8, "BidDataImportTest",_
Path, False, Range
Loop Until Row = 20 'Stop Condition for row counter
transferspreadsheet command. I am able to select the correct range, but I get
a runtime Error 3011 - could not find 'B9,D3,D4,D5,H9'
The table being populated has fields [StdNo], [ProjNo], [CIP], [LetDate],
[UnitCost], where [StdNo] is in cells B9:B##, and [UnitCost] is in cells
H9:H##. The [ProjNo] - D3, [CIP] - D4, and [LetDate] - D5 are only shown in
the 'header' of the spreadsheet, but this data needs to be attached to each
unit cost entered into the table (UnitCosts are entered from all projects,
and calculations are made based on the let date).
CODE:
Dim Path, Range As String, Row As Integer
Path = "P:\Projects - Current\ProjBook.xls"
Do
Row = 9
Range = "B" & Row & ",D3,D4,D5,H" & Row
DoCmd.TransferSpreadsheet acImport, 8, "BidDataImportTest",_
Path, False, Range
Loop Until Row = 20 'Stop Condition for row counter