View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Reading a text file line by line

Try something like the following:

Dim S As String
Open "H:\test.txt" For Input As #1 ' change filename
Do Until EOF(1)
Line Input #1, S
Debug.Print S
Loop
Close #1


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"stressman"
wrote in
message
...

I am looking to bring data into a excel file as a string one
line at a
time so I can evaluate the type of data on the line. When I
have found
the right data I can brake the string up into the right cells.
The line
might have the load case, data type or loads. How do I open
the text
file with VBA in Excel and read the file line by line into a
string?


--
stressman
------------------------------------------------------------------------
stressman's Profile:
http://www.excelforum.com/member.php...o&userid=28139
View this thread:
http://www.excelforum.com/showthread...hreadid=476545