Text to rows

P

Phippsy

I have text in a cell which has been forced onto separate rows within the
same cell. Can I split this into several rows so there is one line in each
new row?
 
G

Gary''s Student

Try this small macro:

Sub rowmaker()
v = ActiveCell.Value
s = Split(v, Chr(10))
For i = 0 To UBound(s)
ActiveCell.Offset(i + 1, 0).Value = s(i)
Next
End Sub

Select the cell and run the macro
 
L

Luke M

Easiest method is usually to use the Data-Text to columns feature, then copy,
paste special - transpose data.
 
P

Phippsy

This works very well thanks

Gary''s Student said:
Try this small macro:

Sub rowmaker()
v = ActiveCell.Value
s = Split(v, Chr(10))
For i = 0 To UBound(s)
ActiveCell.Offset(i + 1, 0).Value = s(i)
Next
End Sub

Select the cell and run the macro
 
P

Phippsy

Thanks for this but becasue there is a forced line break there is no way I
can specify a separator unless I am misunderstanding what to do.
 
G

Gord Dibben

To split at the forced line break in delimited by>other hold the Alt key and
type 0010 on the numpad.


Gord Dibben MS Excel MVP
 
P

Phippsy

Excellent thank you!

Gord Dibben said:
To split at the forced line break in delimited by>other hold the Alt key and
type 0010 on the numpad.


Gord Dibben MS Excel MVP
 

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