For those interested in the implementation of this with only slicers that the user is using, here are some subroutines. It does seem to speed everything up quite a bit:
This one will disconnect all connected slicers form all PT:
Sub disconect_slicers()
Dim start_time, end_time
start_time = Now()
Application.Calculation = xlManual
For Each sh In ThisWorkbook.Sheets
For Each pivot In sh.PivotTables
pivot.ManualUpdate = True
For Each sl In ThisWorkbook.SlicerCaches
sl.PivotTables.RemovePivotTable (pivot)
Next sl
pivot.ManualUpdate = False
Next pivot
Next sh
end_time = Now()
MsgBox (DateDiff("s", start_time, end_time))
End Sub
And this one will reconnect one the used slicers to only the pivot tables on the active sheet:
Sub connect1sheet()
Dim start_time, end_time
start_time = Now()
For Each pivot In ActiveSheet.PivotTables
pivot.ManualUpdate = True
For Each sl In ThisWorkbook.SlicerCaches
If sl.VisibleSlicerItems.Count <> sl.SlicerItems.Count Then
sl.PivotTables.AddPivotTable (pivot)
End If
Next sl
pivot.ManualUpdate = False
Next pivot
end_time = Now()
MsgBox (DateDiff("s", start_time, end_time))
End Sub
Bookmarks