Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort row values descending
I need to sort values in a row in descending order.
Example: 1,5,6,7 2,6,3,5 3,2,8,1 Should sort: 7,6,5,1 6,5,3,2 8,3,2,1 I can't figure out the code to do this. Any help? Here's what I have so far: For Each rw In Worksheets("qrysctrucks").Rows rw.Select Selection.Sort Key1:=Rows(1), Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight, _ DataOption1:=xlSortNormal Next rw |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sort row values descending
Wendy;
You don't need a macro, but you can use the recorder to see what it spits out when you do this : Select a row, or the rows Choose Sort. In the dialogbox, choose options. Choose : sort left to right. Choose your order and there you go. Mark. More Excel ? www.rosenkrantz.nl or -------------------------------------------------------------------- "Wendy" wrote in message ... I need to sort values in a row in descending order. Example: 1,5,6,7 2,6,3,5 3,2,8,1 Should sort: 7,6,5,1 6,5,3,2 8,3,2,1 I can't figure out the code to do this. Any help? Here's what I have so far: For Each rw In Worksheets("qrysctrucks").Rows rw.Select Selection.Sort Key1:=Rows(1), Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight, _ DataOption1:=xlSortNormal Next rw |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
For Each Sheet in Range - Sort Descending | Excel Worksheet Functions | |||
Sort macro with descending | New Users to Excel | |||
Ascending Sort formula, change to neg #: descending sort.. | Excel Discussion (Misc queries) | |||
how do i sort a set of averages and have them list in descending o | Excel Worksheet Functions | |||
how can I hide sort ascending and sort descending options in the . | Excel Discussion (Misc queries) |