Hello,
I am creating a userform, and I want one of the fields on the form to be populated from a pivot table that can be filtered using (currently, this may change) 5 slicers. So far, the macro I have successfully populates the listbox with the data, but it includes Pivot Items that have been removed by the slicers. I need the populated data to be dynamic based on these slicers. My code so far below:
Edit: and yes I have already set "number of items to retain per field" to "none". Still doesn't work.
Any help would be much appreciated!
I am creating a userform, and I want one of the fields on the form to be populated from a pivot table that can be filtered using (currently, this may change) 5 slicers. So far, the macro I have successfully populates the listbox with the data, but it includes Pivot Items that have been removed by the slicers. I need the populated data to be dynamic based on these slicers. My code so far below:
Edit: and yes I have already set "number of items to retain per field" to "none". Still doesn't work.
Code:
Private Sub UserForm_Initialize()
Dim strTimeArray() As String
Dim intTimeCounter As Integer
Dim strDayExArray() As String
Dim intDayExCounter As Integer
Dim PT As PivotTable
Dim PF As PivotField
Dim intEmailCount As Integer
'Dim lngEmailList As Long
Set PF = Worksheets("Distribution List").PivotTables("Distribution List").PivotFields("Email")
With RefineAttendeesIncludeList
For intEmailCount = 1 To PF.PivotItems.Count
.AddItem PF.PivotItems(intEmailCount)
Next
End With
Any help would be much appreciated!
Last edited: