Quote Originally Posted by wendyto View Post
It works! Thank you very much for your teaching!
Hi, the above code works for only 2 pivot tables.

I need code for connecting multiple pivot tables which are named say 10A,10B,10C etc., to a single slicer (Type).

my recorded macro is showing error, below is the recorded code

ActiveWorkbook.SlicerCaches("Slicer_Type").PivotTables. _
        AddPivotTable (ActiveSheet.PivotTables("10A"))
    ActiveWorkbook.SlicerCaches("Slicer_Type").PivotTables. _
        AddPivotTable (ActiveSheet.PivotTables("10B"))
    ActiveWorkbook.SlicerCaches("Slicer_Type").PivotTables. _
        AddPivotTable (ActiveSheet.PivotTables("10C"))
    ActiveWorkbook.SlicerCaches("Slicer_Type").PivotTables. _
        AddPivotTable (ActiveSheet.PivotTables("10D"))