I am trying to convert a column of data into multiple rows but cant
seem to figure out how to do it.
e.g.
a
b
c
d
e
f
g
h
i
I want this column to be broken down into rows of 3 items
a b c
d e f
g h i
Thanks in advance
Karol Stachura - 27 Mar 2008 20:00 GMT
1.Fill a B column with numbers in order, start from number 3 ->
3,4,5,6,7,8... and so on
2.In cell C1 add =if(MOD(B1;3)<>0;"";A1) - drag command in column C to the
end of data
3.In cell D1 add =if(MOD(B1;3)<>0;"";A2) - drag command in column D to the
end of data
4.In cell E1 add =if(MOD(B1;3)<>0;"";A3)- drag command in column E to the
end of data
5.In cell F1 add =if(MOD(B1;3)<>0;"";B1/3) - drag command in column F to
the end of data
6.Copy columns C,D,E,F and paste special as values in the same columns.
7.Sort C,D,E,F by column D
Regards,
Karol Stachura
Gord Dibben - 27 Mar 2008 22:24 GMT
Sub ColtoRows()
Dim rng As Range
Dim I As Long
Dim J As Long
Set rng = Cells(Rows.Count, 1).End(xlUp)
J = 1
On Error Resume Next
nocols = InputBox("Enter Number of Columns Desired")
For I = 1 To rng.Row Step nocols
Cells(J, "A").Resize(1, nocols).Value = _
Application.Transpose(Cells(I, "A") _
.Resize(nocols, 1))
J = J + 1
Next
Range(Cells(J, "A"), Cells(rng.Row, "A")).ClearContents
Exit Sub
End Sub
Enter 3 in the inputbox to get the configuration you want.
Gord Dibben MS Excel MVP
>I am trying to convert a column of data into multiple rows but cant
>seem to figure out how to do it.
[quoted text clipped - 18 lines]
>
>Thanks in advance
introtologic - 28 Mar 2008 14:45 GMT
Thank you!
Both solutions worked excellent