ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Sorting (https://www.excelbanter.com/excel-discussion-misc-queries/35267-sorting.html)

Greg

Sorting
 
I have a worksheet which is made up of three columns, I was wondering is
there a way to have a macro sort them into groups of 50 and have them go
into orders of

1 - 50 into columns a - c
51 - 100 columns e-g
101 - 150 columns i - k

I need it to count the rows and sort into how many pages necessary.

It is a dynamic worksheet but the most rows it will have is 1100


Is this possible?

Thanks in advance
Greg



Don Guillett

See if this works. If satisfied then simply delete columns a,b,c with the
last line.

Sub arrangeem()
For i = 1 To Cells(Rows.Count, "a").End(xlUp).Row Step 50
lc = Cells(1, "iv").End(xlToLeft).Column + 1
Cells(i, 1).Resize(50, 3).Copy Cells(1, lc)
Next i
'Columns("a:c").Delete
End Sub

--
Don Guillett
SalesAid Software

"Greg" wrote in message
...
I have a worksheet which is made up of three columns, I was wondering is
there a way to have a macro sort them into groups of 50 and have them go
into orders of

1 - 50 into columns a - c
51 - 100 columns e-g
101 - 150 columns i - k

I need it to count the rows and sort into how many pages necessary.

It is a dynamic worksheet but the most rows it will have is 1100


Is this possible?

Thanks in advance
Greg






All times are GMT +1. The time now is 08:29 PM.

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