Pivot table Get Pivot Data where grand total is above a certain number

jscranton

Well-known Member
Joined
May 30, 2011
Messages
707
I have a pivot table with a lot of data in it. I am summarizing that data using the GetPivotData command. The data contains engagements (thousands of them) and then subtotals for hundreds of different activities. All of the sub-total hours across all activities is the "Grand Total" for each engagement.

This code, for example, is fairly simply for returning the entire total for all hours billed under Hourly Billing.

Code:
Set pt = ws.PivotTables("PivotTable13")
hourTotal = pt.GetPivotData("Total_Hours_In_Number", "Activity_Nickname_1", "Hourly Billing")

What I am trying to figure out is how to limit the data to engagements that cross certain thresholds for total hours. So, if I wanted to get the Hourly Billing totals for all engagement that have a total of 1000 or more hours, I would think it would be something like this (But this obviously doesn't work):

hourTotal = pt.GetPivotData("Total_Hours_In_Number", "Activity_Nickname_1", "Hourly Billing", "Grand Total", >=1000)

I know that I can loop through the entire pivot table and get what I need via a loop but I was hoping to save some machine time if possible.

Thanks,

J
 

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