Sub ImportMultipleCSVin1Sheet()
'source: [201213] - jindon
Dim strPath$, strFile$, temp
Dim rep$, fCSV$, wb As Workbook: Set wb = ActiveWorkbook
With Application.FileDialog(msoFileDialogFolderPicker)
If .Show Then rep = .SelectedItems(1) & "\"
End With
strPath = rep: strFile = "AllInOne.csv"
temp = Shell("cmd.exe /c copy " & strPath & "*.csv " & strPath & strFile)
With ActiveSheet
With .QueryTables.Add(Connection:="TEXT;" & strPath & strFile, _
Destination:=.Range("A1"))
.Name = Replace(strFile, ".csv", "")
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False 'True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End With
Kill strPath & strFile
End Sub