chirayu
Well-Known Member
Hi Guys,
First off this macro is in a way related to the following thread
http://chandoo.org/forum/threads/vba-slicer-basic-code.27395/
Basically I decided to now create a pure UserForm version of the macro (God its so much simpler to code). But I'm having an issue with the Multi Select ListBox.
I'm using fmMultiSelectMulti
The way it checks if something is selected in the Listbox is as follows:
Problem I'm having is that I sometimes get a False being filtered in the Pivot.
I think its because sometimes when I click on a different Item in the ListBox to select it & click on the previous item to deselect it, a faint dotted line remains around the previous item as if its highlighted. Wonder if that's causing the False to be seen as True.
Please can you guys help me fix this issue as I can't figure it out. This is the only thing I need to fix before I release the UserForm version into the Vault.
First off this macro is in a way related to the following thread
http://chandoo.org/forum/threads/vba-slicer-basic-code.27395/
Basically I decided to now create a pure UserForm version of the macro (God its so much simpler to code). But I'm having an issue with the Multi Select ListBox.
I'm using fmMultiSelectMulti
The way it checks if something is selected in the Listbox is as follows:
Code:
With ActiveSheet.PivotTables(SelPvt).PivotFields(SelPvtF)
For i = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) = True Then
On Error Resume Next
.PivotItems(i + 1).Visible = True
Else
On Error Resume Next
.PivotItems(i + 1).Visible = False
End If
Next
End With
Problem I'm having is that I sometimes get a False being filtered in the Pivot.
I think its because sometimes when I click on a different Item in the ListBox to select it & click on the previous item to deselect it, a faint dotted line remains around the previous item as if its highlighted. Wonder if that's causing the False to be seen as True.
Please can you guys help me fix this issue as I can't figure it out. This is the only thing I need to fix before I release the UserForm version into the Vault.
Last edited: