Pivot Values

  • Thread starter Bradford Patten
  • Start date
B

Bradford Patten

Can anyone assist me in finding the value of a pivot table field?

I have the following code which cycles through my states, but I want to get
the value associated with each one:

With Activesheet.PivotTables(1).PivotFields("STATE")
For i = 1 to .PivotItems.Count
temp = .PivotItems(i)
Next i
End With

I would like something exactly like GETPIVOTDATA, but it doesn't seem to be
available in VBA. I have played with grabbing the value from the appropriate
cell on the sheet, but if you change the layout this fails. I have also
played with setting a cell with the GETPIVOTDATA function and taking the
data from that cell, but it seems there has to be a simple code to get the
value of an item in a pivot.

Thanks,
--bnpatten
 

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

Top