Hi All, I am Converting Mutliple csv in Multiple worksheet in one excel workbook, I have Macro working for the conversion, Files are PIPE(|) deliminator. I need help in adding 2 more logic to code 1- Make all column in Text 2-Replace CHR(10) line feed character with blank. Thanks Srivas
Sub IMPORT_CSV() Dim file_name As String Dim row_number As String Dim output_sheet As String For rep = 4 To 3 + Sheets("Admin").Range("D1").Value file_name = Sheets("Admin").Range("G" & rep).Value row_number = Sheets("Admin").Range("F" & rep).Value output_sheet = Sheets("Admin").Range("E" & rep).Value With Sheets(output_sheet).QueryTables.Add(Connection:= _ "TEXT;" + file_name, Destination:=Sheets(output_sheet).Range(row_number)) .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .RefreshStyle = xlInsertDeleteCells .AdjustColumnWidth = True
.RefreshPeriod = 0 .TextFilePromptOnRefresh = False .TextFilePlatform = 437 .TextFileStartRow = 1 .TextFileParseType = xlDelimited .TextFileTextQualifier = xlTextQualifierDoubleQuote .TextFileConsecutiveDelimiter = False .TextFileTabDelimiter = False .TextFileSemicolonDelimiter = False .TextFileCommaDelimiter = True .TextFileSpaceDelimiter = False .TextFileOtherDelimiter = "|" .TextFileTrailingMinusNumbers = True .Refresh BackgroundQuery:=False End With Next rep End Sub