Hi,
I'm fairly new to VBA and stuck on a problem. I have code that works to select a static list of items in a Slicer, but I would like to update it and make it dynamic based on a range of returned values in a range, for example A1:A6 (or last cell with data). How would I go about modifying this.
Below is what I currently have, where the A1/2/3 Text are the cells that are hardcoded names I would like dynamic based on a range of cells.
Thank you in advance for your help.
I'm fairly new to VBA and stuck on a problem. I have code that works to select a static list of items in a Slicer, but I would like to update it and make it dynamic based on a range of returned values in a range, for example A1:A6 (or last cell with data). How would I go about modifying this.
Below is what I currently have, where the A1/2/3 Text are the cells that are hardcoded names I would like dynamic based on a range of cells.
Thank you in advance for your help.
Code:
ActiveWorkbook.SlicerCaches("Slicer_Master_Project_ID_And_Name"). _
ClearManualFilter
ActiveWorkbook.SlicerCaches("Slicer_Master_Project_ID_And_Name"). _
VisibleSlicerItemsList = Array( _
"[Projects].[Master Project ID And Name].&[A1 Text]", "[Projects].[Master Project ID And Name].&[A2 Text]", _
"[Projects].[Master Project ID And Name].&[A3 Text]", "[Projects].[Master Project ID And Name].&[A4 Text]", _
"[Projects].[Master Project ID And Name].&[Last cell in A range with text]",
Last edited by a moderator: