Dear sirs:
I have the following pivot table:
<tbody>
</tbody>
I need to code in VBA a macro that allow me to group the cities according the %share column. In the following way:
<tbody>
</tbody>
As you can see what I need is create a group called for Rest that includes (add) all cities whose %share value be under 25%. Moreover each subtotal row must keep the same previous value.
In advance, thanks a lot.
Best regards
Hernan Covarrubias
h.covarru@gmail.com
PS: If anyone needs the worksheet I can send it.
I have the following pivot table:
Row Labels | Sum of Q2017 | Sum of Q2018 | Diff_Q | %Share |
East | 5265 | 4639 | -626 | 38% |
Boston | 2290 | 1994 | -296 | 47% |
Philadelphia | 1045 | 879 | -166 | 27% |
New York | 1811 | 1709 | -102 | 16% |
Miami | 119 | 57 | -62 | 10% |
West | 1620 | 612 | -1008 | 62% |
Seattle | 437 | 55 | -382 | 38% |
Portland | 444 | 107 | -337 | 33% |
Las Vegas | 237 | 82 | -155 | 15% |
San Diego | 422 | 338 | -84 | 8% |
San Francisco | 80 | 30 | -50 | 5% |
Total general | 6885 | 5251 | -1634 | 100% |
<tbody>
</tbody>
I need to code in VBA a macro that allow me to group the cities according the %share column. In the following way:
Row Labels | Sum Q2017 | Sum Q2018 | Diff_Q | %Share |
East | 5265 | 4639 | -626 | 38% |
Boston | 2290 | 1994 | -296 | 47% |
Philadelphia | 1045 | 879 | -166 | 27% |
Rest | 1930 | 1766 | -164 | 26% |
West | 1620 | 612 | -1008 | 62% |
Seattle | 437 | 55 | -382 | 38% |
Portland | 444 | 107 | -337 | 33% |
Rest | 739 | 450 | -289 | 29% |
Total general | 6885 | 5251 | -1634 | 100% |
<tbody>
</tbody>
As you can see what I need is create a group called for Rest that includes (add) all cities whose %share value be under 25%. Moreover each subtotal row must keep the same previous value.
In advance, thanks a lot.
Best regards
Hernan Covarrubias
h.covarru@gmail.com
PS: If anyone needs the worksheet I can send it.