Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import of multiple .CSV files into Excel
Hi @ll,
I need to build a macro to import data from all .csv files located in specific directory into an Excel file (on the same sheet)... I have manage to build a single extract (with 1 file) but I need to b able to loop threw all files, extract the data, copy and paste and th bottom of the sheet... Here is the code of the macro for the single extract : Sub Macro1() With ActiveSheet.QueryTables.Add(Connection:= _ "TEXT;C:\Test\test.csv", _ Destination:=Range("A1")) .Name = "test" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .RefreshStyle = xlDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .TextFilePromptOnRefresh = False .TextFilePlatform = xlWindows .TextFileStartRow = 4 .TextFileParseType = xlDelimited .TextFileTextQualifier = xlTextQualifierDoubleQuote .TextFileConsecutiveDelimiter = False .TextFileTabDelimiter = False .TextFileSemicolonDelimiter = False .TextFileCommaDelimiter = True .TextFileSpaceDelimiter = False .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1 1, 1, 1, 1, 1, 1) .Refresh BackgroundQuery:=False End With End Sub Please advise, Thx Ayat -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Import Multiple XML Files into Excel | Excel Discussion (Misc queries) | |||
import multiple csv files into excel 2007 | Excel Discussion (Misc queries) | |||
Excel VBA - Import Data for manipulation from multiple text files | Excel Programming | |||
Import multiple text files into excel | Excel Programming | |||
Import multiple files macro can't find files | Excel Programming |