C
Cooz
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
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