Please Help

Bassai

New Member
Joined
Sep 3, 2012
Messages
9
Hi

I need to move data from 5 rows in one column and to separate columns. The data looks like this

Infinity Auto Import
20 Puriri Street, New Lynn, Auckland
09 9512882
View dealer listings
IV Cars
90 Portage Road, Otahuhu, Auckland
09 9512843
But needs to be sorted like this:
Column AColumn BColumn C
Infinity Auto Import20 Puriri Street, New Lynn, Auckland09 9512882
IV Cars90 Portage Road, Otahuhu, Auckland09 9512843
I would appreciate your help

<colgroup><col><col><col></colgroup><tbody>
</tbody>
 

Some videos you may like

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

ranman256

Well-known Member
Joined
Jun 17, 2014
Messages
1,887
adjust as needed...

Rich (BB code):
Sub ParseFile()
Dim vFile, vLine
Dim i As Integer
Const Q = """"
vFile = "C:\temp\textfile.txt"
Range("a2").Select
i = 1
Open vFile For Input As #1 
While Not EOF(1)
  Line Input #1 , vLine
  vLine = Trim(vLine)
  
  If InStr(vLine, "View dealer listings") > 0 Then vLine = ""
  
    If vLine <> "" Then
        ActiveCell.Offset(0, i - 1).Value = vLine
        
        i = i + 1
        If i = 4 Then
          i = 1
          ActiveCell.Offset(1, 0).Select  'next row
        End If
    End If
Wend
Close 1
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,099,044
Messages
5,466,213
Members
406,473
Latest member
Dunno123

This Week's Hot Topics

Top