Updating a pivot table based on selecting a choice in a list

JMorrison619

New Member
Joined
Mar 2, 2010
Messages
3
Hello,

I was wondering if it's possible to update a filter in a pivot table (with source information coming from an OLAP cube) simply by selecting a choice in a drop down list that is identical to the choices you can filter by. I know that it is possible to filter a pivot table that has it's source data within the workbook by using the following VBA code:


Private Sub Worksheet_Change(ByVal Target As Range)

If Intersect(Target, Range("B5")) Is Nothing Then
Exit Sub
Else

Dim pt As PivotTable
For Each pt In ThisWorkbook.ActiveSheet.PivotTables
pt.PivotFields("Community Short Name").CurrentPage _
= Range("B5").Value
Next
End If
End Sub


I just get the error "Unable to get the PivotFields property of the PivotTable class" when I try to do the same things with the OLAP cube.

Thanks for any help you can provide.

Jimmy
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,215,650
Messages
6,126,012
Members
449,280
Latest member
Miahr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top