Hi everyone,
The code below is a modification to the one in the thread. The original code works fine for comma-delimited files since they whole file takes only one row. When I tried to modify for tab-delimited files, it only imports the first row and then gives me an error (1004). Does anyone know how to resolve this issue?
Thanks in advance.
abousetta
Option Explicit
Sub TabFile()
Dim TabFile As String
Dim sq
TabFile = Application.GetOpenFilename("Text Files,*.txt")
Open TabFile For Input As #1
sq = Split(Replace(Input(LOF(1), #1), Chr(9), "|"), "|")
Close #1
'Application-defined or object-defined error (Run-time error '1004'
ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1).Resize(, UBound(sq) + 1) = sq
End Sub
Bookmarks