LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Start reading text file at line 3

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading a text file line by line stressman Excel Programming 3 October 16th 05 05:29 AM
Reading a text file line by line Foss[_2_] Excel Programming 4 March 16th 05 04:01 PM
Trying to start a second line ( ie use of enter key) in an output file Susan Hayes Excel Programming 1 February 26th 05 09:20 PM
Excel 2000 Hanging while reading large file with Line Input Jacques Brun Excel Programming 4 February 21st 04 05:05 PM


All times are GMT +1. The time now is 03:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"