Is there a Text to Rows function instead of Text to Columns?

rodcard1027

New Member
Joined
Aug 21, 2014
Messages
5
Hi I'm using Excel 2010 on Windows 7 Pro.
I have a text string that is using the ^ symbol as a delimiter and I need to be able to separate the text into new rows rather than new columns. The formula would also need to create the new rows required so as to not overwrite the next line of data below it. Is this possible without using a macro? I'm not against using one, I just wouldn't know where to start.

Below is a pic of some sample data. The top part is how it's listed, and the bottom (in yellow) is how I would like to have it. Any help or useful tips are greatly appreciated!

6hQU2.gif



Thanks!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
grr you said to rows not columns sorry

If no one gives a way there is a method here
 
Last edited:
Upvote 0
No worries.

I should add that I have tried a work around by first performing TtoC first then transposing that into individual rows which works when I only have a single text string with blank rows beneath it to transpose into. Unfortunately, it doesn't work when I have multiple strings in consecutive rows such as in my example.
 
Upvote 0
rodcard1027,

Welcome to Mr Excel.

Are you open to a vba solution?
 
Upvote 0
Here's a macro you can try (untested) on a copy of your worksheet.
Code:
Sub rodcard1027()
Dim lR As Long, i As Long, Ct As Long
lR = Range("A" & Rows.Count).End(xlUp).Row
Application.ScreenUpdating = False
For i = lR To 3 Step -1
    Ct = Len(Cells(i, "A")) - Len(Replace(Cells(i, "A"), "^", ""))
    If Ct > 0 Then
        Cells(i, "A").Offset(1, 0).Resize(Ct, 1).EntireRow.Insert
        With Cells(i, "A").Resize(Ct + 1, 1)
            .Value = WorksheetFunction.Transpose(Split(Cells(i, "A"), "^"))
        End With
    End If
Next i
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Heres another....(Hopefully tested)

Code:
Sub Breakout()
Application.ScreenUpdating = False
LR = Cells(Rows.Count, 1).End(xlUp).Row
For r = LR To 2 Step -1
Set MyCell = Cells(r, 1)
Arry = Split(MyCell.Value, "^")
For c = 0 To UBound(Arry)
If c > 0 Then MyCell.Offset(c, 0).EntireRow.Insert
MyCell.Offset(c, 0) = Arry(c)
Next c
Next r
End Sub

Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,226,038
Messages
6,188,512
Members
453,479
Latest member
pnewkirk12

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