vzachin
04-21-2009, 04:50 AM
hi,
how can i modify the following code so that it will run on a .txt file that is already opened.i will only have one .txt file opened and the name of the file will not always be the same.
Sub GetTextTest1()
Dim InputData, sTxt, i As Long
Open "C:\file2.txt" For Input As #1
Do While Not EOF(1)
i = i + 1
Line Input #1, InputData
Cells(i, 1) = InputData
Loop
Close #1
End Sub
thanks
zach
how can i modify the following code so that it will run on a .txt file that is already opened.i will only have one .txt file opened and the name of the file will not always be the same.
Sub GetTextTest1()
Dim InputData, sTxt, i As Long
Open "C:\file2.txt" For Input As #1
Do While Not EOF(1)
i = i + 1
Line Input #1, InputData
Cells(i, 1) = InputData
Loop
Close #1
End Sub
thanks
zach