title: How to use a macro that wil update a pivot table, inside a pivot table update event without causing an infinite loop
body: <p>How to use a macro that wil update a pivot table, inside a pivot table update event without causing an infinite loop</p>
  
  <pre><code>     Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
  
       Dim ONS As Boolean
  
       If ONS = True Then Exit Sub
       ONS = True
  
       'Line of code that will update the pivot table
  
        ActiveWorkbook.SlicerCaches("Slicer_MSS_Top_Parent_org1"). _
      VisibleSlicerItemsList = Array( _
      "[CA_analysis_0501_final].[MSS Top Parent org].&amp;[0]")
  
      End Sub
  </code></pre>