Sub ReadLineByLine() Dim strLine As String Dim oFS As Object Dim oTS As Object Dim lineNumber As Integer Set oFS = CreateObject("Scripting.FileSystemObject") Set oTS = oFS.OpenTextFile("C:\SYDNEY ERS_121713.txt") Do While oTS.AtEndOfStream = False strLine = oTS.Readline Dim Item1 As String Dim RowItm As Long RowItm = Range("A65536").End(xlUp).Row + 1 ColItm = "A" & RowItm Item1 = Mid(strLine, 3, 23) Range(ColItem).Value = Item1 ' Error Occurs here! Loop oTS.Close Set oTS = Nothing Set oFS = Nothing End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)