Sum columns dynamically

G

Guest

Hi,

I have a table as follows:

A1 A2 A3 A4 A5 A6 A7 A8 A9
Description M-6 M-5 M-4 M-3 M-2 M-1 M1 M2 etc etc
A 1 2 3 4 5 6 7 8
j 5 6 7 8 9 10 11 12
v 4 5 0 0 0 0 5 6
etc

Description M-2 M-1 M1 M2 M3 M4 M5 M6 etc etc
hhg 1 2 3 4 5 6 7 8
ert 5 6 7 8 9 10 11 12
pdr 4 5 0 0 0 0 5 6
etc


This table is populated from different sources (via VBA), but will always
have headings. The problem is, the headings my vary eg one table may have
M-1 M1 M2 M3 to M120 another may be as above, but the descrpition (and
therefore the table) will always start in Column A.

I now need to map this to a different table with any value that is contained
in M-6 M-5 M-4 M-3 M-2 M-1 summed in one column in the new table. The
items in the description column are all variable etc.

Does anyone have any ideas??
 
G

Guest

One thing you can do is add some code to the VBA to create a listing aside
from the table, with the headers description, Ms, and data. It will be
something like:
Desc Ms Data
A M-6 1
A M-5 2
....
pdr M6 6

If you can manage to get that listing, you can use it as the base for a
pivot table, with the description on the rows, the Ms on the columns and the
sum of data as the data. It will make all the aggregations for you.

Hope this helps,
Miguel.
 

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

Top