title: Iterate over slicer via VBA and select a single item each time
body: <p>I have several slicers within a spreadhseet. I'd like to be able to loop over one of these via VBA, and select every option one by one. 
  The macro below seems fine to my tired eyes, but it obviously doesn't work when I run it. When I add a breakpoint at the 'BREAKPOINT tag here below, the first item gets selected, but then the macro goes to the second one while keeping the first one selected and I end up with all my items selected...</p>
  
  <pre><code>    Sub slicers(slName As String)
      Dim slItem As SlicerItem, slDummy As SlicerItem
      Dim slBox As SlicerCache
      Set slBox = ActiveWorkbook.SlicerCaches(slName)
      For Each slItem In slBox .SlicerItems
        For Each slDummy In slBox .SlicerItems
            slDummy.Selected = (slDummy.Name = slItem.Name)
        Next slDummy
      Next slItem 'BREAKPOINT
      End Sub
  
      Sub test()
      Call slicers("A_slicer_name")
      End Sub
  </code></pre>
  
  <p>Thanks for your help</p>
  
  <p><strong>EDIT:</strong><br>
  As pointed out by Scott Holtzman, turns out that I just need to clear the filter (slBox.ClearManualFilter) upon selecting a new item. </p>
  
  <p><strong>Why is that necessary whereas the boolean test works properly when I debug.print it?</strong></p>
  
  <p>The code below works fine:</p>
  
  <pre><code>    Sub slicers(slName As String)
      Dim slItem As SlicerItem, slDummy As SlicerItem
      Dim slBox As SlicerCache
      Set slBox = ActiveWorkbook.SlicerCaches(slName)
      For Each slItem In slBox .SlicerItems
        slBox.ClearManualFilter 'THIS IS THE LINE I NEEDED TO ADD
        For Each slDummy In slBox .SlicerItems
            slDummy.Selected = (slDummy.Name = slItem.Name)
        Next slDummy
      Next slItem
      End Sub
  
      Sub test()
      Call slicers("A_slicer_name")
      End Sub
  </code></pre>