Sub RedoList()
Dim LastR As Long, LastC As Long
Dim arr As Variant
Dim r As Long, c As Long
Dim CellContents As Variant
Dim MaxRows As Long
Dim DestR As Long
With ActiveSheet
LastR = .Cells(.Rows.Count, 1).End(xlUp).Row
LastC = .Cells(1, .Columns.Count).End(xlToLeft).Column
arr = .Range(.Cells(1, 1), .Cells(LastR, LastC)).Value
End With
Worksheets.Add
DestR = 1
For r = 1 To UBound(arr, 1)
MaxRows = 0
For c = 1 To UBound(arr, 2)
If arr(r, c) <> "" Then
CellContents = Split(arr(r, c), Chr(10))
Cells(DestR, c).Resize(UBound(CellContents) + 1, 1) = Application.Transpose(CellContents)
If (UBound(CellContents) + 1) > MaxRows Then MaxRows = (UBound(CellContents) + 1)
End If
Next
DestR = DestR + MaxRows
Next
MsgBox "Done"
End Sub
|