LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Get Line From Text File


Try this for starters

I am assuming you do not have more than 65536 rows in the text file

Sub Macro1()
Const conFile As String = "D:\MSN Hotmail - Message.txt"
Const conFind As String = "TIMEBAND REPORT"
Dim lRow As Long

Workbooks.OpenText Filename:=conFile, Origin:= _
xlWindows, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False
Semicolon:=False _
, Comma:=False, Space:=False, Other:=False, FieldInfo:=Array(1, 1), _
TrailingMinusNumbers:=True
lRow = Cells.Find(What:=conFind, After:=ActiveCell, LookIn:=xlFormula
_
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Row

MsgBox Cells(lRow + 1, 1).Value

End Su

--
mudrake
-----------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...nfo&userid=247
View this thread: http://www.excelforum.com/showthread.php?threadid=54022



 
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
import huge text file line-by-line? rachel Excel Programming 2 November 6th 04 04:43 PM
Delete a line in text file Francis Ang[_2_] Excel Programming 2 June 11th 04 04:26 AM


All times are GMT +1. The time now is 10:38 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"