converting line-delimited text into cells

W

Wowbagger

I have a text file with approximately 1000 lines of data, each line is 100
chars or less.

The first 15 lines are column headers (some columns are unused), then every
12 subsequent lines is one record.

What is the easiest way to get each record to appear in Excel (2007) on a
single line, one field per column?

Thank you
 
D

Don Guillett

If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.
 
D

Don Guillett

Sub GETDATA()

With Sheet2.Range("a1:a200")
Set c = .Find(What:="FILE ID #", LookIn:=xlValues, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=True)
r = 2
If Not c Is Nothing Then
firstAddress = c.Address
Do
'MsgBox c.Row
With Sheet3
.Cells(r, 4) = c.Offset(10)
.Cells(r, 5) = c
End With
Set c = .FindNext(c)
r = r + 1

Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top