ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Rows to Columnsq (https://www.excelbanter.com/excel-programming/434806-rows-columnsq.html)

JOE POLLOCK

Rows to Columnsq
 
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?
--
JOE

joel

Rows to Columnsq
 
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




"JOE POLLOCK" wrote:

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?
--
JOE



All times are GMT +1. The time now is 11:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com