Here is a code that I use for text files, I simply adapted the extention .csv, normally it should be OK
Code:
Sub ImportTxtNew ()
Sun Line As String, strFullName, i As Long, As Long NbWs
Sun Deb As Variant, End As Variant, Diff As Date
Deb = Now ()
Worksheets. Add
strFullName = Application. GetOpenFileName ( "Text Files (*. csv), *. csv", _
"Select a file:")
StrFullName Open For Input As # 1
Do While Not EOF (1)
Do While (Not EOF (1)) And (i <65500)
i = i + 1
Input # 1, line
Cells (i, 1). Value = line
Loop
If i <EOF 65,500 Gold (1) Then Exit Do
i = 0
Worksheets. Add
Loop
Close # 1
End Sub
Bookmarks