Thread
:
Sort row values descending
View Single Post
#
2
Posted to microsoft.public.excel.programming
Mark Rosenkrantz[_2_]
external usenet poster
Posts: 33
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 With Quote
Mark Rosenkrantz[_2_]
View Public Profile
Find all posts by Mark Rosenkrantz[_2_]