Sub
ImportCSV()
Dim
strPath
As
String
strPath =
"C:\Users\Dirk\Documents\test.csv"
ActiveWorkbook.Worksheets.Add
With
ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;"
& strPath, Destination:=Range(
"$A$1"
))
.Name =
"test"
.FieldNames =
True
.RowNumbers =
False
.FillAdjacentFormulas =
False
.PreserveFormatting =
True
.RefreshOnFileOpen =
False
.RefreshStyle = xlInsertDeleteCells
.SavePassword =
False
.SaveData =
True
.AdjustColumnWidth =
True
.RefreshPeriod = 0
.TextFilePromptOnRefresh =
False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter =
False
.TextFileTabDelimiter =
True
.TextFileSemicolonDelimiter =
False
.TextFileCommaDelimiter =
False
.TextFileSpaceDelimiter =
False
.TextFileColumnDataTypes = Array(2, 2, 2)
.TextFileTrailingMinusNumbers =
True
.Refresh BackgroundQuery:=
False
End
With
End
Sub