Reputation: 209
strRange = "C:C,H:H,J:J,S:S,AA:AA"
DoCmd.TransferSpreadsheet , cSpreadsheetTypeExcel12Xml, "tbl_adds", strInputFileName, True, stRange
The spreadsheet in question has 40 columns of which I only need 5 (listed in stRange)
Is this a syntax thing or do I have to use a different method?
Upvotes: 0
Views: 43
Reputation: 55841
Don't import but link the worksheet.
Create a simple select query with the linked table as source. In this, mark the five columns in question and save the query.
Now use this query for your import.
Upvotes: 2