i am learning do loop and eof statement through the following
but does anybody have an idea about what the code doing
For my understanding ,the code trying to find if the "total" column exists on the first row.
but what are these "Do While Not EOF(1)
Line Input #FileNumber, Data"
why do i need them
but does anybody have an idea about what the code doing
For my understanding ,the code trying to find if the "total" column exists on the first row.
but what are these "Do While Not EOF(1)
Line Input #FileNumber, Data"
why do i need them
Sub DemoWhileClause()
' Page 115 at the bottom
Open ThisWorkbook.Path & Application.PathSeparator & "Invoice.txt" For Input As #1
r = 1
Do While Not EOF(1)
Line Input #FileNumber, Data
If Not Left(Data, 5) = "TOTAL" Then
' Import this row
r = r + 1
Cells(r, 1).Value = Data
End If
Loop
Close #1
End Sub