sure.Give us a little file to play with…
Sub Demo()
Dim slItem As SlicerItem
For Each slItem In ThisWorkbook.SlicerCaches("Segment_Number_item").SlicerItems
x = Application.Match(slItem.Name, Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row), 0)
If IsNumeric(x) Then
slItem.Selected = True
Else
slItem.Selected = False
End If
Next
End Sub
ActiveWorkbook.SlicerCaches("Slicer_Date.Dates2").VisibleSlicerItemsList = _
Array( _
"[Date].[Dates].[Month].&[20180101]", "[Date].[Dates].[Day].&[20180201]")
Sub Bouton1_Cliquer()
Dim ar1
Dim strConst as String
strConst = "[Plage].[Number item].&["
ReDim ar1(1 To Cells(Rows.Count, "H").End(xlUp).Row - 1)
For i = 1 To UBound(ar1)
ar1(i) = strConst & Cells(i + 1, "H").Value2 & "]"
Next
ThisWorkbook.SlicerCaches("Segment_Number_item1").VisibleSlicerItemsList = ar1
End Sub
With Sheets("Lists")
ReDim ar1(1 To .Cells(Rows.Count, "H").End(xlUp).Row - 1)
End With
For i = 1 To UBound(ar1)
ar1(i) = strConst & Cells(i + 1, "H").Value2 & "]"
Next