Rows to Columnsq

  • Thread starter Thread starter JOE POLLOCK
  • Start date Start date
J

JOE POLLOCK

I have a large number of rows that are made up of approximately 5000 records
with 10 rows per record. I want to take every ten rows and distribute it into
separate columns , and do that in each following row for each of the next
records. What is the easiest way to do that?
 
I'm going to do this using 20 rows per column since excel 2003 is limited to
256 columns 5000/20 = 250). I'm also assuming the data is in column A and
the results will be put starting in column B.

Sub splitrows()
NewCol = 2
LastRow = Range("A" & Rows.Count).End(xlUp).Row
For RowCount = 1 To LastRow Step 20
Range("A" & RowCount & ":A" & (RowCount + 19)).Copy _
Destination:=Cells(1, NewCol)
NewCol = NewCol + 1
Next RowCount
End Sub
 
Back
Top