7
我想問您的幫助有以下幾點:導入CSV文件導入Excel
我有我需要進口在Excel中分析數據的軟件應用程序中導出CSV文件。每日生成40-50個CSV。現在我通過「從文本獲取外部數據」手動完成此操作。在導入過程中記錄的代碼是:
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;SYSTEM:Users:catalin:Documents:LINELLA:WH Analytics:data:pick 01-18:050:Inquiry closed lists SKU_0142.csv" _
, Destination:=Range("A1704"))
.Name = "Inquiry closed lists SKU_0142"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlMacintosh
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileOtherDelimiter = ";"
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.Refresh BackgroundQuery:=False
.UseListObject = False
End With
Selection.End(xlDown).Select
Range("A1710").Select
我希望能夠從選定的文件夾,我會把新文件並啓動導入過程中自動導入所有CSV文件。每個文件應該在前一個文件的最後一行之後立即插入。
您的幫助將不勝感激。
也許[這個插件會](http://superuser.com/questions/307496/how-can-i-set-excel-to-always-import-all-columns-of-csv -files-as-text/527894#527894)有用嗎?您仍然需要手動選擇最後一行(CTRL +向下),但其餘的將自動完成。 – nixda