Text to rows

  • Thread starter Thread starter Phippsy
  • Start date Start date
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?
 
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
 
Easiest method is usually to use the Data-Text to columns feature, then copy,
paste special - transpose data.
 
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
 
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.
 
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
 
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
 
Back
Top