Hi All,
I recorded a macro to see if there was a way after I inserted 3 slicers, to select report connections for each of the slicers to select pivot table without having to
right click and select report connections for each slicer.
This is the below macro code from the recorder:
Sub Macro3()
'
' Macro3 Macro
'
'slicer 1
ActiveSheet.Shapes.Range(Array("Team Member Name")).Select
ActiveWorkbook.SlicerCaches("Slicer_Team_Member_Name").PivotTables. _
AddPivotTable (ActiveSheet.PivotTables("PivotTable2"))
'slicer 2
ActiveSheet.Shapes.Range(Array("Opportunity Owner Name")).Select
ActiveWorkbook.SlicerCaches("Slicer_Opportunity_Owner_Name").PivotTables. _
AddPivotTable (ActiveSheet.PivotTables("PivotTable2"))
'slicer 3
ActiveSheet.Shapes.Range(Array("Account Record Type")).Select
ActiveWorkbook.SlicerCaches("Slicer_Account_Record_Type").PivotTables. _
AddPivotTable (ActiveSheet.PivotTables("PivotTable2"))
End Sub
when I run the code, it gives me the following error
and error in code is shown below
Any help provided would be great and been searching for the last few hours and nothing. Thanks as always.
I recorded a macro to see if there was a way after I inserted 3 slicers, to select report connections for each of the slicers to select pivot table without having to
right click and select report connections for each slicer.
This is the below macro code from the recorder:
Sub Macro3()
'
' Macro3 Macro
'
'slicer 1
ActiveSheet.Shapes.Range(Array("Team Member Name")).Select
ActiveWorkbook.SlicerCaches("Slicer_Team_Member_Name").PivotTables. _
AddPivotTable (ActiveSheet.PivotTables("PivotTable2"))
'slicer 2
ActiveSheet.Shapes.Range(Array("Opportunity Owner Name")).Select
ActiveWorkbook.SlicerCaches("Slicer_Opportunity_Owner_Name").PivotTables. _
AddPivotTable (ActiveSheet.PivotTables("PivotTable2"))
'slicer 3
ActiveSheet.Shapes.Range(Array("Account Record Type")).Select
ActiveWorkbook.SlicerCaches("Slicer_Account_Record_Type").PivotTables. _
AddPivotTable (ActiveSheet.PivotTables("PivotTable2"))
End Sub
when I run the code, it gives me the following error
and error in code is shown below
Any help provided would be great and been searching for the last few hours and nothing. Thanks as always.