Hi All,
Currently I have a system in place that will update a slicer based upon ONE value that is chosen from a drop down box.
See code below:
However, I now need to be able to select multiple items from a slicer. For example - my field is RevType. Instead of choosing just Budget, I want to be able to choose Budget AND Actual.
So in response to this I then created a Userform where a user can select multiple items and those values will be concatenated and show in a different cell (i.e. Actual, Budget).
How do I change my code to look through the cell with the concatenated items and manipulate my slicer to correspond to those items?
Thanks for any help.
Currently I have a system in place that will update a slicer based upon ONE value that is chosen from a drop down box.
See code below:
Code:
Sub DropDownValue_Rev()
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
Dim PT As PivotTable
Dim wb As Workbook
Dim ws As Worksheet
Set wb = ThisWorkbook
For Each ws In wb.Sheets
For Each PT In ws.PivotTables
PT.ManualUpdate = True
Next PT
Next ws
Dim dbWS As Worksheet
Dim lbText As String
Set dbWS = Sheets("Dashboard")
With ActiveSheet.Shapes("DropDownRev").ControlFormat
lbText = .List(.Value)
End With
dbWS.Range("J5") = lbText
Dim revSel As String
revSel = dbWS.Range("J5")
Dim item As SlicerItem
wb.SlicerCaches("Slicer_Revenue_Type").ClearManualFilter
For Each item In wb.SlicerCaches("Slicer_Revenue_Type").SlicerItems
If item.Name = revSel Then
item.Selected = True
Else
item.Selected = False
End If
Next item
For Each ws In wb.Sheets
For Each PT In ws.PivotTables
PT.ManualUpdate = False
Next PT
Next ws
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlAutomatic
End Sub
However, I now need to be able to select multiple items from a slicer. For example - my field is RevType. Instead of choosing just Budget, I want to be able to choose Budget AND Actual.
So in response to this I then created a Userform where a user can select multiple items and those values will be concatenated and show in a different cell (i.e. Actual, Budget).
How do I change my code to look through the cell with the concatenated items and manipulate my slicer to correspond to those items?
Thanks for any help.