View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Debra Dalgleish Debra Dalgleish is offline
external usenet poster
 
Posts: 2,979
Default Getpivottable function

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
'=====================

Raypat wrote:
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



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html