Hi All
Does anyone know if it's possible to extract a pivot table subtotal with VBA?
I'd like to get the value 13 from the below table into a variable
i.e where 'RESULTS' field = 'TBC'
And it is possible, how would I handle errors if there are no TBC results in the pivot table?
Pivot Table - Bobs Jungle Gym.png![]()
Sub GetTotalTBCs() Dim TBCs As Integer TBCs = ActiveSheet.PivotTables("PivotTable1").PivotFields("Result") = "TBC".Subtotal.value End Sub
Any advice appreciated
All the best
Vicky
Bookmarks