-
[VBA]Option Explicit
Option Compare Text
Sub Test()
Dim fs, a
Dim t As String
Dim MyFile As String
Dim i As Long
MyFile = Application.GetOpenFilename("Text Files,*.txt")
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.openTextFile(MyFile)
Do
t = a.readline
Loop Until InStr(1, t, "resistor") > 0
i = 1
Cells(i, 1) = t
t = a.readline
Do
i = i + 1
Cells(i, 1) = t
t = a.readline
Loop Until InStr(1, t, "nodes") > 0
a.Close
End Sub
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules