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>
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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
 
Upvote 0

Forum statistics

Threads
1,213,515
Messages
6,114,080
Members
448,548
Latest member
harryls

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top