Hi,
I have created an Excel Table where rows and data are changing when a macro is run. In the table, there is a column which I need to show the weighted value for each level group. Please can you show me an easy way to programmatically get totals for each level without converting the table to a range. Eg based on table below, the weighted column is calculated based on the totals for each level group ie
level, value qty weighted
01 10 1 =sum of qty for level 01/sum of values for level 01
01 20 5
01 30 10
02 20 9 =sum of qty for level 02/sum of values for level 02
02 1 8
03 2 6 =sum of qty for level 03/sum of values for level 03
03 2 4
03 100 20
Note, the levels and their range varies from run to run. The weighted column needs to be based on a formula as the user can change the qty and values after the macro is run and the weighted column has to be recalculated. Ideally the weighted values should show only at change of group but if I have to repeat the formula, for each of the rows in the group,it is okay. Note also, I could have many of such tables in the worksheet (again generated programmatically).
Thank you in advance.
Bookmarks