Maybe
tabl = split(rec, Application.International(xlListSeparator))
(I'm not sure if this is available in all versions, though.)
"Daniel.C" wrote:
NB.
Replace :
Tabl = Split(Rec, ";")
with
Tabl = Split(Rec, ",")
to fit your regional settings.
Daniel
Try the following macro. You may select one or more files in the dialog box.
Sub test()
Dim Rec As String, Tabl, myRow As Long
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = True
.Filters.Clear
.Filters.Add "CSV Files", "*.CSV"
.Show
For i = 1 To .SelectedItems.Count
Sheets.Add
Close #1
Open .SelectedItems(i) For Input As #1
Do While Not EOF(1)
Line Input #1, Rec
Tabl = Split(Rec, ";")
myRow = myRow + 1
For j = 0 To UBound(Tabl)
Cells(myRow, j + 1) = Tabl(j)
Next j
Loop
Close #1
Next i
End With
End Sub
HTH
Daniel
I've been generating .csv files daily which contains data of 5 columns and
roughly 2000 rows. Could all these file be brought into one single Excel
work book with each day as a separate worksheet?
I tried downloading the ADD ins from http://www.rondebruin.nl/copy2.htm
but this add in merges all the files in one single work sheet.
Please let me know if anyone knows a way to automate it.
Thanks in Advance.....
--
Dave Peterson