Getpivottable function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use the getpivotable function within VBA but am unable to do
so..

Tried to use the following

application.worksheet.getpivottable

I get an error. I am able to use getpivottabledata within a worksheet as a
formula no problem..

Basically I am attempting to obtain summary information from a pivot table
and automating it within a Macro..


Regards,

Ray Pathak
 
GetPivotData is a method of the PivotTable, and there's an example in
Excel VBA help:

'================
Sub UseGetPivotData()

Dim rngTableItem As Range

' Get PivotData for the quantity of chairs in the warehouse.
Set rngTableItem = ActiveCell. _
PivotTable.GetPivotData("Quantity", "Warehouse", "Chairs")

MsgBox "The quantity of chairs in the warehouse is: " _
& rngTableItem.Value

End Sub
'=====================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top