samuelimtech
07-09-2014, 02:07 AM
Hi all.
This must be soo simple nobody has asked the question before lol
all Im after is a quick code that will import only 2 columns from a spreadsheet. I at the stage below and have tried various combinations but cant get it working.
the code should be sufficient for your to understand what im trying to achieve.
Dim MyFile As String
Dim MyPath As String
MyPath = "T:\Inter Urban\Consultancy Services\Timesheets\Templates\Access\"
MyFile = "HA Systems input master.xlsm"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Job-Account", _
MyPath & MyFile, _
True, "Direct Labour codes!A:A" & "Direct Labour codes!F:F"
End Sub
thanks for any help
This must be soo simple nobody has asked the question before lol
all Im after is a quick code that will import only 2 columns from a spreadsheet. I at the stage below and have tried various combinations but cant get it working.
the code should be sufficient for your to understand what im trying to achieve.
Dim MyFile As String
Dim MyPath As String
MyPath = "T:\Inter Urban\Consultancy Services\Timesheets\Templates\Access\"
MyFile = "HA Systems input master.xlsm"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Job-Account", _
MyPath & MyFile, _
True, "Direct Labour codes!A:A" & "Direct Labour codes!F:F"
End Sub
thanks for any help