Hello all,
Today I am working on some pivottable/slicer manipulation through VBA... here's what I have
Code works great, however its slow as dirt...any tips to speed this up? I know I will always only be selecting one name if that can help me...
Today I am working on some pivottable/slicer manipulation through VBA... here's what I have
Code:
Sub ManipulatePivots()
'
' ManipulatePivots Macro
'
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Pivots by Machine")
Dim name
Set name = ws.Range("A1")
Dim thing
Application.ScreenUpdating = False
With ActiveWorkbook.SlicerCaches("Slicer_Name")
For i = 1 To ActiveWorkbook.SlicerCaches("Slicer_Name").SlicerItems.Count
If .SlicerItems(i).Caption = name Then
.SlicerItems(i).Selected = True
Else
.SlicerItems(i).Selected = False
End If
Next i
End With
Application.ScreenUpdating = True
End Sub