Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Reading a text file line by line | Excel Programming | |||
Reading a text file line by line | Excel Programming | |||
import huge text file line-by-line? | Excel Programming | |||
Delete a line in text file | Excel Programming |