Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Sorting rows left to right numerically
I need to create a macro to sort 659 rows by 46 columns. The rows contain
numeric values that need to be sorted for lowest (left) to highest (right). When I sort manually left to right, the values for every row are not sorted correctly. Additionally when I sort manually, the left column in some rows are blank. This is a spreadsheet that has cells that have been manually updated. Macro below Sub SortLefttoRight() ' ' SortLefttoRight Macro ' Macro recorded 12/1/2007 by Carlton A. Barlow ' ' Range("G15:AZ673").Select Range("AZ673").Activate Selection.Sort Key1:=Range("G15"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight, _ DataOption1:=xlSortNormal End Sub All help is greatly appreciated |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Sorting rows left to right numerically
When sorting rows, each row moves as a unit. What you have is just a normal row sort turned on its side. Each column moves as a unit. You will have to run a loop and sort each row separately. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) -check out "Special Sort"- "Carlton A. Barlow" wrote in message I need to create a macro to sort 659 rows by 46 columns. The rows contain numeric values that need to be sorted for lowest (left) to highest (right). When I sort manually left to right, the values for every row are not sorted correctly. Additionally when I sort manually, the left column in some rows are blank. This is a spreadsheet that has cells that have been manually updated. Macro below Sub SortLefttoRight() ' SortLefttoRight Macro ' Macro recorded 12/1/2007 by Carlton A. Barlow ' Range("G15:AZ673").Select Range("AZ673").Activate Selection.Sort Key1:=Range("G15"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight, _ DataOption1:=xlSortNormal End Sub All help is greatly appreciated |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Right to Left sorting without changing language settings | Excel Discussion (Misc queries) | |||
sorting contents from right to left | Excel Worksheet Functions | |||
Sorting Right to Left | Excel Worksheet Functions | |||
Sorting Numerically | Excel Worksheet Functions | |||
Sorting in reverse (from right-to-left and from top-to-bottom) | Excel Discussion (Misc queries) |