Sort row values descending

  • Thread starter Thread starter Wendy
  • Start date Start date
W

Wendy

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
 
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 (e-mail address removed)
 
I've done that. I need it to loop through an entire spreadsheet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top