LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Bring different .csv files in to one single Excel work book

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Splitting an excel work book in to two Shailesh Excel Discussion (Misc queries) 3 September 1st 08 04:29 PM
excel work book Gerry Excel Discussion (Misc queries) 2 June 30th 08 03:04 PM
bring .tps files into excel Knox Excel Discussion (Misc queries) 6 October 24th 07 10:20 PM
How do I bring Lotus123 files over in to Excel Makayla Excel Discussion (Misc queries) 3 April 25th 06 02:19 PM
How to insert pdf files into Excel work book. rowboat Excel Discussion (Misc queries) 1 January 31st 05 06:26 PM


All times are GMT +1. The time now is 10:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"