I would go with @Mark L solution - it is more elegant and flexible than TextToColumns
If your original data is a row of values, TextToColumns gets a bit clumsy
- a separate "play" area is required and
- VBA has to clean up after itself
eg with values in A1:Z1
(CurrentRegion needs blank cells around it - hence AB1 not AA1 for "play" area)
Sub TextToRows()
With Range("AB1")
Range("A1:Z1").Copy: .PasteSpecial Paste:=xlPasteValues, Transpose:=True
.Resize(.End(xlDown).Row).TextToColumns DataType:=xlDelimited, ConsecutiveDelimiter:=True, Space:=True
.CurrentRegion.Copy: Range("A1").PasteSpecial Paste:=xlPasteValues, Transpose:=True
.CurrentRegion.Clear
End With
End Sub
Solution from @Marl L only needs a loop and a minor mod to achieve the same
For c = Range("A1").Column To Range("Z1").Column
ap = Split(Cells(1, c).Value): Cells(1).Resize(UBound(ap) + 1).Offset(, c - 1).Value = Application.Transpose(ap)
Next c
Bookmarks