Filtering Pivot Table values with VBA

BobPierre

New Member
Joined
Jun 5, 2018
Messages
8
Good day,

I want the Macro to filter out values of distance less than 30km and do a Pivot table as well as also doing for the whole data.
So that that I will have 2 pivot tables, one for the whole data and the other for less than 30km.
Like this:
s/nColumnDistanceRow LabelsCount of Distance
1a0.72a15Row LabelsCount of Distance
2a21.2b3a12
3d0.42c6b3
4d1.88d11c6
5d1.88(blank)d9
6b22.42Grand Total35(blank)
7b0.13Grand Total30
8b1.06
9a1.86
10a19.4
11a49.44
12a11.35
13c16.82
14c19.2
15c19.45
16c0.53
17a0.89
18a31.53
19a25.1
20a1.08
21a0.9
22a1.03
23a71.06
24a0.18
25d1.1
26d33.61
27c1.01
28d2.04
29c0.92
30d0.94
31d58.81
32d29.37
33d1.08
34d0.87
35a0.93

<colgroup><col><col><col><col span="2"><col><col><col><col><col span="3"></colgroup><tbody>
</tbody>

<colgroup><col span="3"><col span="2"><col><col><col><col><col span="2"></colgroup><tbody></tbody>

<colgroup><col span="2"><col><col span="2"><col><col><col><col><col span="2"></colgroup><tbody>
</tbody>
Thank you all in advance
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,215,139
Messages
6,123,264
Members
449,093
Latest member
Vincent Khandagale

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top