I am trying to write code that will display data for the appropriate month selected by the user. I have attached a sample file that has the following error:
"Unable to set the visible property of the pivot item class."
Thank You in advance
![]()
I am trying to write code that will display data for the appropriate month selected by the user. I have attached a sample file that has the following error:
"Unable to set the visible property of the pivot item class."
Thank You in advance
![]()
Last edited by Aland2929; 07-19-2010 at 06:13 AM.
Change your OK button code to this:
![]()
Private Sub OKButton_Click() Dim pt As PivotTable, pi As PivotItem Dim DateChosen As String Application.ScreenUpdating = False Set pt = Sheets("Pivot").PivotTables("ChannelSummary") DateChosen = ListBox1.Value With pt .ManualUpdate = True .PivotFields("Month").PivotItems(DateChosen).Visible = True For Each pi In .PivotFields("Month").PivotItems If pi.Name <> DateChosen Then pi.Visible = False Next pi .ManualUpdate = False End With Unload Me End Sub
Everyone who confuses correlation and causation ends up dead.
Thank you very much Romperstomper. It works perfectly. I will work through it to understand it.
![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks