title: How can I filter a slicer for one item through VBA?
body: <p>My slicer contains over 100 cities and I'd like to filter the slicer through VBA on one city at a time (in order to print the region of the chart into a Powerpoint). The trouble is that I think I would have to list every other city and show them as "Selected = False". I need a code block where I only specify the city/cities I and the rest of the slicer options are "Selected = False" by default.</p>
  
  <p>I've recorded the macro code below and I've searched the net for a solution to this problem but have come up empty-handed.</p>
  
  <pre><code> With ActiveWorkbook.SlicerCaches("Slicer_City")
          .SlicerItems("New York").Selected = True
          .SlicerItems("Chicago").Selected = False
          .SlicerItems("Trenton").Selected = False
          .SlicerItems("Atlanta").Selected = False
          .SlicerItems("Houston").Selected = False
          .SlicerItems("Los Angeles").Selected = False
  '  there are 100 more cities to list if I just wanted "New York" to be selected 
         'in the slicer
  End With
  </code></pre>
  
  <p>I need code where I should only specify the selection (New York) and not declare every other city as "Selected = False".</p>