LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default CODE rectification while sorting in descending order

Hello all,

I have a a small set like this:

1.1 1 1 1 0 0 3
1.2 1 0 0 1 0 2
1.3 1 0 0 0 0 1
2.1 0 1 1 1 1 4
2.2 1 1 1 1 1 5

This set should be rearranged according to the descending order of the
last column. i.e. last column is sorted in descending order and its
corresponding rows are swapped accordingly.

End result would be:

2.2 1 1 1 1 1 5
2.1 0 1 1 1 1 4
1.1 1 1 1 0 0 3
1.2 1 0 0 1 0 2
1.3 1 0 0 0 0 1

I am using a code like this.

sub test()

Dim rng As Range

Set rng = Range("A2:G6") ' where A2 is 1 and G6 is 5
rng.Copy Destination:=Range("A10") ' copies the range to the A10 and
pastes the range

Range("O6").CurrentRegion.Sort Key1:=Range("O6"), Order1:=xlDescending

end sub

How to change the code to arrive at the end result as given in the
example above? Please help.

Thanks,
Thulasiram

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
descending order of a series of data kent[_2_] Excel Worksheet Functions 8 December 14th 09 05:00 AM
How to order chart in descending order of Freq? Gary Charts and Charting in Excel 1 October 1st 09 01:03 PM
Top 10 in descending order Esradekan Excel Worksheet Functions 8 September 24th 07 02:54 AM
DESCENDING ORDER -in Form Marilyn Excel Discussion (Misc queries) 2 January 13th 07 05:31 PM
How do I match all columns into descending order Kiwi Jane New Users to Excel 2 October 13th 06 01:10 AM


All times are GMT +1. The time now is 09:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"