Thanks for this code. What if the slicer is on a different sheet than the pivot table?