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