Heres a little different approach
Sub ReadTabTextFile()
Const sPath As String = "C:\Users\Mike\Desktop\"
Const sFile As String = "N01-S5A-1-VB0401-5A1-SC_B_70_09-10-12_21_chr.txt"
Dim FileNum As Integer
Dim TotalFile As String
Dim arrData() As Variant
FileNum = FreeFile
' Reads the entire file into memory all at once
Open sPath & sFile For Binary As #FileNum
TotalFile = Space(LOF(FileNum))
Get #FileNum, , TotalFile
Close #FileNum
Lines = Split(TotalFile, vbNewLine)
ReDim arrData(1 To UBound(Lines), 1 To 44)
For x = LBound(Lines) To UBound(Lines) - 2
Fields = Split(Lines(x), vbTab)
For y = LBound(Fields) To UBound(Fields)
' Now the array can be used in the mdb comparing
arrData(x + 1, y + 1) = Fields(y)
Next y
Next
Worksheets("Sheet4").Range("A1").Resize(UBound(arrData), UBound(arrData, 2)) = arrData
End Sub
Bookmarks