Hi
Hope this makes sense! guidance would be much appreciated....
I send out a monthly report that is sent to 21 different organisations. All of the 21 organisations info is held in one excel spreadsheet and i use a pivot table and dropdown box to filter the information. The next procedure is to copy and paste this information into individual packs (Word)
I am in the process of automating the process and have wrote a macro which works fine. The issue I have is that I don't really want to duplicate the code 21 times as all i am changing is the dropdown box selection to pick the next organisation. From the code below can any one help me by showing me how to change the code in just one area? The organisation that changes is shown as [CENTRAL NNEC]. I am assuming that calling a public sub is the way to go???
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[PRACTICE].[PRACTICE].[PCT]").VisibleItemsList = Array("")
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[PRACTICE].[PRACTICE].[Cluster]").VisibleItemsList = Array("")
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[PRACTICE].[PRACTICE].[Practice]").VisibleItemsList = Array( _
"[PRACTICE].[PRACTICE].[Practice].&[CENTRAL NNEC]")
Thanks for your help
Hope this makes sense! guidance would be much appreciated....
I send out a monthly report that is sent to 21 different organisations. All of the 21 organisations info is held in one excel spreadsheet and i use a pivot table and dropdown box to filter the information. The next procedure is to copy and paste this information into individual packs (Word)
I am in the process of automating the process and have wrote a macro which works fine. The issue I have is that I don't really want to duplicate the code 21 times as all i am changing is the dropdown box selection to pick the next organisation. From the code below can any one help me by showing me how to change the code in just one area? The organisation that changes is shown as [CENTRAL NNEC]. I am assuming that calling a public sub is the way to go???
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[PRACTICE].[PRACTICE].[PCT]").VisibleItemsList = Array("")
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[PRACTICE].[PRACTICE].[Cluster]").VisibleItemsList = Array("")
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[PRACTICE].[PRACTICE].[Practice]").VisibleItemsList = Array( _
"[PRACTICE].[PRACTICE].[Practice].&[CENTRAL NNEC]")
Thanks for your help