ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sorting multiple columns as one (https://www.excelbanter.com/excel-programming/342427-sorting-multiple-columns-one.html)

Randy

Sorting multiple columns as one
 
Hi, what I want to do is sort multiple columns as one range. Example here is
sorting descending on B, F, and I
col a colb col c col e col f col g col h col i
col j
Name Score Rank Name Score Rank Name Score Rank

Fred 7 3 Art 6 4 George
8 2
Norma 4 5 Dumdum 1 6 Zeek 9
1


The results i want are a down then across sort:

Zeek 9 1 Fred 7 3 Norma 4
5
George 8 2 Art 6 4 Dumdum 1 6

Currently I have a separate part of the sheet where I build all the names in
one column, sort them, and then just have the final table reference them in
sequence. The Rank determines the rank in the one column sorted table. This
is done with macros but real VBA is ok.

I guess the question(s) a Can I do a multi-column sort and can the Rank
function handle multiple ranges?

Thanks
--

Randy

Tom Ogilvy

Sorting multiple columns as one
 
Using your secondary table is probably the easiest way.

Of couse you could sort, rank and write the data back all in code.

--
Regards,
Tom Ogilvy


"Randy" wrote in message
...
Hi, what I want to do is sort multiple columns as one range. Example here

is
sorting descending on B, F, and I
col a colb col c col e col f col g col h col

i
col j
Name Score Rank Name Score Rank Name Score Rank

Fred 7 3 Art 6 4 George
8 2
Norma 4 5 Dumdum 1 6 Zeek 9
1


The results i want are a down then across sort:

Zeek 9 1 Fred 7 3 Norma 4
5
George 8 2 Art 6 4 Dumdum 1

6

Currently I have a separate part of the sheet where I build all the names

in
one column, sort them, and then just have the final table reference them

in
sequence. The Rank determines the rank in the one column sorted table.

This
is done with macros but real VBA is ok.

I guess the question(s) a Can I do a multi-column sort and can the Rank
function handle multiple ranges?

Thanks
--

Randy





All times are GMT +1. The time now is 01:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com