J
Joel
I have created a spreadsheet, that links to another source data spreadsheet.
The source data spreadsheet is exported from SAP (our ERP system). All the
brains are programmed in the new spreadsheet that links to the exported file.
Of all the data that gets exported, there are two columns I'm interested in,
Inventory Value and Material Group.
What I would like to do is to group by the different material groups, sum
their Inventory Values, and sort the resulting sum in descending order
through VBA code. The results would then be displayed on a chart.
One problem is that every time the data source spreadsheet is refreshed, the
number and name of Material Groups can vary. Therefore, I can't hard-code the
material group names.
Of course, the same data is used on other worksheets for other graphs as
well. I am trying to code the operations listed in the Chart_Activate( )
event, and 'undo' all the sorting and grouping in the Chart_Deactivate( )
event.
Any ideas?
Here's an example:
Source Data:
Material Group Inventory Value .........
----------------------------------------------------------
Machined Metal $495.00
Printed Circuit Assy $2,364.93
Plastic and Rubber $416.00
Sheet Metal $625.00
Sheet Metal $250.00
Printed Circuit Assy $2,364.75
Printed Circuit Assy $2,187.24
Printed Circuit Assy $155.15
Summary Report (Inv $ Sum & Sort):
Material Group Inventory Value
The source data spreadsheet is exported from SAP (our ERP system). All the
brains are programmed in the new spreadsheet that links to the exported file.
Of all the data that gets exported, there are two columns I'm interested in,
Inventory Value and Material Group.
What I would like to do is to group by the different material groups, sum
their Inventory Values, and sort the resulting sum in descending order
through VBA code. The results would then be displayed on a chart.
One problem is that every time the data source spreadsheet is refreshed, the
number and name of Material Groups can vary. Therefore, I can't hard-code the
material group names.
Of course, the same data is used on other worksheets for other graphs as
well. I am trying to code the operations listed in the Chart_Activate( )
event, and 'undo' all the sorting and grouping in the Chart_Deactivate( )
event.
Any ideas?
Here's an example:
Source Data:
Material Group Inventory Value .........
----------------------------------------------------------
Machined Metal $495.00
Printed Circuit Assy $2,364.93
Plastic and Rubber $416.00
Sheet Metal $625.00
Sheet Metal $250.00
Printed Circuit Assy $2,364.75
Printed Circuit Assy $2,187.24
Printed Circuit Assy $155.15
Summary Report (Inv $ Sum & Sort):
Material Group Inventory Value