Hello
I have a Pivot Table that is constructed from a macro which sometimes works and sometimes doesn't. The reason being is I have three seperate groups in the Pivot Table and the third group changes in size each month. In my macro for the third group I currently have;
Range("M12:M38").Select
Selection.Group
So I had 27 different types in this group when the macro was created but I want to change the code in the macro so it searches for the last cell before the Grand Total in the Pivot Table and will then group from M12 (always constant) to that last Active Cell and label it as International. This is an extract of what my Pivot Table currently looks like and in it you will see the International Group only has four diferent types this time;
Sum of Duration
Type Prefix Total
Fixed 02 493.27
03 105.55
07 320.13
08 198.84 1117.79 (subtotal of Fixed, Cell currently outside of Pivot Table)
Mobile 04 797.27 797.27 (subtotal of Mobile, Cell currently outside of Pivot Table)
International 32 487.48
44 27.56
62 112.25
66 140.26 767.55 (subtotal of International, Cell outside of Pivot Table)
Grand Total 2682.61
I will also need the subtotal of the third group to be variable as well. These subtotals are currently outside the PivotTable but can be moved inside the Pivot Table if it makes it easier code wise inside the Macro.
Any help would be greatly appreciated.
Bookmarks