Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sort every row
I have about a thousand rows of data (with 6 columns).
How can I quickly sort every row in ascending order? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sort every row
Sub SortRows()
'Tom Ogilvy macro Dim r As Long Dim Lrow As Long Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Lrow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row 'Make the r = 1 whatever the first row of data you want to sort on is. 'The Cells(r, 1) means your data starts in Col 1 or Col A - adjust as necessary 'The resize(1, 4) expands the range to 1 cell deep by 4 cells wide For r = 1 To Lrow With Cells(r, 2).Resize(1, 7) .Sort Key1:=Cells(r, 2), Order1:=xlAscending, Header:=xlGuess, _ Orientation:=xlLeftToRight, DataOption1:=xlSortNormal End With Next r Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic End Sub Gord Dibben MS Excel MVP On Fri, 1 Jun 2007 13:24:00 -0700, user2089 wrote: I have about a thousand rows of data (with 6 columns). How can I quickly sort every row in ascending order? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
sort function to sort for bell curve | Excel Discussion (Misc queries) | |||
data sort is not including all columns in sort | Excel Discussion (Misc queries) | |||
Excel sort by Fill Color by custom list sort | Excel Discussion (Misc queries) | |||
Excel Sort function should not sort the cell formatting! | Excel Worksheet Functions | |||
how can I hide sort ascending and sort descending options in the . | Excel Discussion (Misc queries) |