My slicer is a list of items codes. I recorded a macro to select the items for me, however when I surpass the 24 line maximum, the VBA no longer works.
I tried repeating the same code with different item #'s, but it unselects the first batch, and only selects the second batch. How would I rewrite the script below to select all item #'s showing?
Note that the Item list will constantly change (and could include up to 2000 items), I'm going to build something in excel that will allow the user to plug in their items, and then in turn it will give them the code to replace the below with.
I'm a newb (users even more so) when it comes to VBA, so need a simple solution that is user friendly.
Item code example: 100035591-001
Sheets("Slicer").Select
ActiveWorkbook.SlicerCaches("Slicer_StyleColorCode").VisibleSlicerItemsList = _
Array( _
"[Products].[StyleColorCode].&[100035591-001]", _
"[Products].[StyleColorCode].&[100035591-02F]", _
"[Products].[StyleColorCode].&[100035591-04J]", _
"[Products].[StyleColorCode].&[100035591-060]", _
"[Products].[StyleColorCode].&[100035591-0EE]", _
"[Products].[StyleColorCode].&[100035591-0IJ]", _
"[Products].[StyleColorCode].&[100035591-0ZB]", _
"[Products].[StyleColorCode].&[100035591-0ZG]", _
"[Products].[StyleColorCode].&[100035591-0ZH]", _
"[Products].[StyleColorCode].&[100035591-16X]", _
"[Products].[StyleColorCode].&[100035591-16Y]", _
"[Products].[StyleColorCode].&[100035591-1AZ]", _
"[Products].[StyleColorCode].&[100035591-1DP]", _
"[Products].[StyleColorCode].&[100035591-1F3]", _
"[Products].[StyleColorCode].&[100035591-1NN]", _
"[Products].[StyleColorCode].&[100035591-1TN]", _
"[Products].[StyleColorCode].&[100035591-1TW]", _
"[Products].[StyleColorCode].&[100035591-1TZ]", _
"[Products].[StyleColorCode].&[100035591-1U3]", _
"[Products].[StyleColorCode].&[100035591-1WD]")
Sheets("Slicer").Select
ActiveWorkbook.SlicerCaches("Slicer_StyleColorCode").VisibleSlicerItemsList = _
Array( _
"[Products].[StyleColorCode].&[100035591-1XN]", _
"[Products].[StyleColorCode].&[100035591-1ZD]", _
"[Products].[StyleColorCode].&[100035591-20A]", _
"[Products].[StyleColorCode].&[100035591-20F]", _
"[Products].[StyleColorCode].&[100036363-001]", _
"[Products].[StyleColorCode].&[100036363-00N]", _
"[Products].[StyleColorCode].&[100036363-060]", _
"[Products].[StyleColorCode].&[100036363-1UK]", _
"[Products].[StyleColorCode].&[100036363-1UL]", _
"[Products].[StyleColorCode].&[100036363-1W6]", _
"[Products].[StyleColorCode].&[100036409-322]", _
"[Products].[StyleColorCode].&[100036836-001]", _
"[Products].[StyleColorCode].&[100036836-00Z]", _
"[Products].[StyleColorCode].&[100036836-03U]", _
"[Products].[StyleColorCode].&[100036836-060]", _
"[Products].[StyleColorCode].&[100036836-06G]", _
"[Products].[StyleColorCode].&[100036836-0EW]", _
"[Products].[StyleColorCode].&[100036836-0WI]", _
"[Products].[StyleColorCode].&[100036836-0ZA]", _
"[Products].[StyleColorCode].&[100036836-17D]")
Sheets("Sheet1").Select
I tried repeating the same code with different item #'s, but it unselects the first batch, and only selects the second batch. How would I rewrite the script below to select all item #'s showing?
Note that the Item list will constantly change (and could include up to 2000 items), I'm going to build something in excel that will allow the user to plug in their items, and then in turn it will give them the code to replace the below with.
I'm a newb (users even more so) when it comes to VBA, so need a simple solution that is user friendly.
Item code example: 100035591-001
Sheets("Slicer").Select
ActiveWorkbook.SlicerCaches("Slicer_StyleColorCode").VisibleSlicerItemsList = _
Array( _
"[Products].[StyleColorCode].&[100035591-001]", _
"[Products].[StyleColorCode].&[100035591-02F]", _
"[Products].[StyleColorCode].&[100035591-04J]", _
"[Products].[StyleColorCode].&[100035591-060]", _
"[Products].[StyleColorCode].&[100035591-0EE]", _
"[Products].[StyleColorCode].&[100035591-0IJ]", _
"[Products].[StyleColorCode].&[100035591-0ZB]", _
"[Products].[StyleColorCode].&[100035591-0ZG]", _
"[Products].[StyleColorCode].&[100035591-0ZH]", _
"[Products].[StyleColorCode].&[100035591-16X]", _
"[Products].[StyleColorCode].&[100035591-16Y]", _
"[Products].[StyleColorCode].&[100035591-1AZ]", _
"[Products].[StyleColorCode].&[100035591-1DP]", _
"[Products].[StyleColorCode].&[100035591-1F3]", _
"[Products].[StyleColorCode].&[100035591-1NN]", _
"[Products].[StyleColorCode].&[100035591-1TN]", _
"[Products].[StyleColorCode].&[100035591-1TW]", _
"[Products].[StyleColorCode].&[100035591-1TZ]", _
"[Products].[StyleColorCode].&[100035591-1U3]", _
"[Products].[StyleColorCode].&[100035591-1WD]")
Sheets("Slicer").Select
ActiveWorkbook.SlicerCaches("Slicer_StyleColorCode").VisibleSlicerItemsList = _
Array( _
"[Products].[StyleColorCode].&[100035591-1XN]", _
"[Products].[StyleColorCode].&[100035591-1ZD]", _
"[Products].[StyleColorCode].&[100035591-20A]", _
"[Products].[StyleColorCode].&[100035591-20F]", _
"[Products].[StyleColorCode].&[100036363-001]", _
"[Products].[StyleColorCode].&[100036363-00N]", _
"[Products].[StyleColorCode].&[100036363-060]", _
"[Products].[StyleColorCode].&[100036363-1UK]", _
"[Products].[StyleColorCode].&[100036363-1UL]", _
"[Products].[StyleColorCode].&[100036363-1W6]", _
"[Products].[StyleColorCode].&[100036409-322]", _
"[Products].[StyleColorCode].&[100036836-001]", _
"[Products].[StyleColorCode].&[100036836-00Z]", _
"[Products].[StyleColorCode].&[100036836-03U]", _
"[Products].[StyleColorCode].&[100036836-060]", _
"[Products].[StyleColorCode].&[100036836-06G]", _
"[Products].[StyleColorCode].&[100036836-0EW]", _
"[Products].[StyleColorCode].&[100036836-0WI]", _
"[Products].[StyleColorCode].&[100036836-0ZA]", _
"[Products].[StyleColorCode].&[100036836-17D]")
Sheets("Sheet1").Select