Bdude11383
New Member
- Joined
- Jun 16, 2011
- Messages
- 1
Hello fellow Mr. Excel fans,
I'm trying to create a multi-select list box that will allow users to filter a group of pivot tables based on their list box selection(s). My list box code is below. The code only succeeds at filtering the last selection chosen in the list box by the user, however I would like the pivot tables to be filtered by all of the selections in the list box. If anyone has an idea on how to fix this, I would be extremely appreciative.
Thanks in advance!
Bdude11383
- - - - - - - -
Private Sub cmdStep2_Click()<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Dim i As Integer<o></o>
Sheets("Direct Lease vs Sublet").PivotTables("PivotTable1").PivotFields("GeographyName").ClearAllFilters<o></o>
Sheets("Direct Lease vs Sublet").PivotTables("PivotTable1").PivotFields("GeographyName").EnableMultiplePageItems = True<o></o>
For i = 0 To SubMarketsListBox.ListCount - 1<o></o>
If SubMarketsListBox.Selected(i) = True Then _<o></o>
Sheets("Direct Lease vs Sublet").PivotTables("PivotTable1").PivotFields("GeographyName").CurrentPage = _<o></o>
SubMarketsListBox.List(i)<o></o>
I'm trying to create a multi-select list box that will allow users to filter a group of pivot tables based on their list box selection(s). My list box code is below. The code only succeeds at filtering the last selection chosen in the list box by the user, however I would like the pivot tables to be filtered by all of the selections in the list box. If anyone has an idea on how to fix this, I would be extremely appreciative.
Thanks in advance!
Bdude11383
- - - - - - - -
Private Sub cmdStep2_Click()<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
Dim i As Integer<o></o>
Sheets("Direct Lease vs Sublet").PivotTables("PivotTable1").PivotFields("GeographyName").ClearAllFilters<o></o>
Sheets("Direct Lease vs Sublet").PivotTables("PivotTable1").PivotFields("GeographyName").EnableMultiplePageItems = True<o></o>
For i = 0 To SubMarketsListBox.ListCount - 1<o></o>
If SubMarketsListBox.Selected(i) = True Then _<o></o>
Sheets("Direct Lease vs Sublet").PivotTables("PivotTable1").PivotFields("GeographyName").CurrentPage = _<o></o>
SubMarketsListBox.List(i)<o></o>