Sorting a large amount of data

vid071892

New Member
Joined
Nov 21, 2011
Messages
1
I have a large amount of data, 97000 rows and 4 columns that I need to sort every 26 rows starting with row 26. I only need 2 columns but I'll take all four if someone knows an easy way to accomplish this task. The data is position and time and the time is in seconds from which I need the 0,.5,1,1.5... all the way to 12577 seconds.

Thanks
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
This will do it, it is sorting on column A:

Rich (BB code):
Option Explicit

Sub SortSpecial()
Dim StartRow As Long, LastRow As Long, Rws As Long, Grp As Long

StartRow = Application.InputBox("What row to begin sorting in groups of rows?", "Start", 26, Type:=1)
If StartRow = 0 Then Exit Sub
Rws = Application.InputBox("How many rows in each group?", "Group Size", 26, Type:=1)
If Rws = 0 Then Exit Sub

LastRow = Range("A" & Rows.Count).End(xlUp).Row
Application.ScreenUpdating = False

For Grp = StartRow To LastRow Step Rws
    Range("A" & Grp).Resize(Rws, 4).Sort Key1:=Range("A" & Grp), Order1:=xlAscending, Header:=xlNo
Next Grp

Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,238
Messages
6,129,654
Members
449,526
Latest member
hmoh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top