Looking for some help from Excel Pivot Table DAX specialists. I'm attempting to access a range of data in a pivot table originating from an OLAP data source. I can't quite get what I need.
The VBA code accesses the entire DataRange for a PivotItem I would like to access a subset of that DataRange - only the Dividends column, for instance.
The following code:
Does this:
But what I want to do is access a subset of data as shown:
Any help is greatly appreciated.
The VBA code accesses the entire DataRange for a PivotItem I would like to access a subset of that DataRange - only the Dividends column, for instance.
The following code:
Code:
Private Sub CommandButton1_Click()
Dim pivotTable As String: pivotTable = "SegmentedReturns"
Dim pivotField As String: pivotField = "[Account Activities].[Fully Qualified Symbol].[Fully Qualified Symbol]"
Dim pt As pivotTable
Set pt = ActiveSheet.PivotTables(pivotTable)
Dim pf As pivotField
Set pf = pt.PivotFields(pivotField)
Dim rng As Range
Set rng = pf.PivotItems(1).DataRange
rng.Select
End Sub
Does this:
But what I want to do is access a subset of data as shown:
Any help is greatly appreciated.