Sort on no less than sixteen keys

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi everyone,

I have a worksheet with a table that contains twenty columns. Four of them
have numeric data. The challenge I face is to sum the data per column in
these four columns for which the data in the other sixteen columns is the
same on each row.

For example:

(row 1) AA ZZ 03 DD FF 10 GG
(row 2) AA ZZ 05 DD FF 02 GG
(row 3) AA ZZ 04 DD EE 05 GG
(row 4) AA ZZ 04 DD EE 01 GG
(row 5) AA ZZ 08 DD FF 02 GG
(row 6) AA ZZ 09 CC FF 01 GG

I must add up the two columns 3 and 6...
- of rows 1, 2 and 5
- of rows 3 and 4
- of row 6
.... because the data in the other five columns of these rows match. Instead
of these two plus five columns, I must deal with four plus sixteen.

To do this, what I need is a sort on sixteen keys -because I need to be
aboslutely sure that all data is in a specific order- check the rows one by
one and perform the calculation whenever a change in one of these keys
occurs. I know how to do the check, but I don't know how to do the sort.

- Is sorting on no less than sixteen keys possible with VBA, and if so, how?
- Can this task perhaps be performed in an easier way that I'm overlooking?

Thank you,
Cooz
.



Relevant Pages

  • Sorting AofH over hash key(s)...
    ... I've searched this NG, the web, and CPAN and haven't seen anything to ... I'd like to sort by the keys: ... Also, my example, with a lot of numeric data is somewhat bad, I ...
    (comp.lang.perl.misc)
  • Re: Sorting AofH over hash key(s)...
    ... an Array of Hashes by an arbitrary number of hash keys. ... I'd like to sort by the keys: ... Also, my example, with a lot of numeric data is somewhat bad, I ...
    (comp.lang.perl.misc)
  • Re: Ability to do numeric and alpha sort in one pass on data which is compirsed of both
    ... WD> I am attempting to sort data which has a combination of both numeric ... Now it would not be so bad, but the numeric data ... Trying to use core Perl verses adding ... you need to mung your keys ...
    (perl.beginners)
  • Re: I dig stumperings.....
    ... infinite impregnability where no-one's troubled by buses. ... suggesting both within and among the keys. ... but one went sort of like this. ...
    (talk.religion.buddhism)
  • Re: a question for sorting keys in Map
    ... I have a Map, actually a TreeMap, which will automatically sort the keys ... You can write your own Comparator object which implements the Compare ... strings so that X10 comes after X2 instead of before it. ... Unix ls command sort file names the way you want your strings to sort. ...
    (comp.lang.java.programmer)