G
Guest
I have the following code and it works as is but I would like the code to
start reading at line three of the text file. Is that possible and if so, how?
Public Sub GetIt()
Set fs = CreateObject("Scripting.FileSystemObject")
Dim r As Integer
Set ImpRng = ActiveCell
strFile = Application.GetOpenFilename
strFile = fs.GetFileName(strFile)
Open strFile For Input As #1
r = 0
Do While Not EOF(1) 'Want to start at line three of text file
Line Input #1, data
ActiveCell.Offset(r, 0) = LTrim(data)
r = r + 1
Loop
Close #1
End Sub
start reading at line three of the text file. Is that possible and if so, how?
Public Sub GetIt()
Set fs = CreateObject("Scripting.FileSystemObject")
Dim r As Integer
Set ImpRng = ActiveCell
strFile = Application.GetOpenFilename
strFile = fs.GetFileName(strFile)
Open strFile For Input As #1
r = 0
Do While Not EOF(1) 'Want to start at line three of text file
Line Input #1, data
ActiveCell.Offset(r, 0) = LTrim(data)
r = r + 1
Loop
Close #1
End Sub