Hi friends,
As the title suggests, I'm trying to sync a common field in two different pivot tables.
I have 2 pivot tables on a single worksheet.
Each table has its own data source - 2 different databases (had to set it up that way to present all the data requested).
The 2 data sources have one column of data in common. This column is called Projects and all project names are the same in both databases.
BUT...
Pivot Table 1: Projects is in the ROW area (multi-select dropdown)
Pivot Table 2: Projects is in the PAGE area (single select drop-down)
I would like to link the Projects data items so that when I select a project name in the Combo box, the same project name would seamlessly be selected in both tables.
Each table would populate with its own data based on the project selected.
Basically, I'd like to use the method illustrated in this Flash file:
http://www.mrexcel.com/wiki/index.php?n=ExcelWiki.SynchronizeTwoPivotTablesWithAComboBox
This method would have worked beautifully if it weren't for this reason:
Table 1: Project data is in the PAGE field
(single selection)
Table 2: Project data is in the ROW field (multi-selection)
If the Projects data was in the PAGE field in both tables, my code would look like this:
ActiveSheet.PivotTables("Table 1").PivotFields("Project").CurrentPage = _ActiveSheet.Range("X1").Value
ActiveSheet.PivotTables("Table 2").PivotFields("Project").CurrentPage = _ActiveSheet.Range("X1").Value
But no, because the ROW field is a multi-select one, I get this kind of code:
ActiveSheet.PivotTables("Table 1").PivotFields("Project").CurrentPage = _
ActiveSheet.Range("X1").Value
With ActiveSheet.PivotTables("Table 2").PivotFields("Project")
.PivotItems("Project 1").Visible = False
.PivotItems("Project 2").Visible = False
.PivotItems("Project 3").Visible = False
.PivotItems("Project 4").Visible = False
.PivotItems("Project 5").Visible = False
.PivotItems("Project 6").Visible = False
End With
End Sub
There are 98 project names. How can I work this out? Surely there is a way.
As the title suggests, I'm trying to sync a common field in two different pivot tables.
I have 2 pivot tables on a single worksheet.
Each table has its own data source - 2 different databases (had to set it up that way to present all the data requested).
The 2 data sources have one column of data in common. This column is called Projects and all project names are the same in both databases.
BUT...
Pivot Table 1: Projects is in the ROW area (multi-select dropdown)
Pivot Table 2: Projects is in the PAGE area (single select drop-down)
I would like to link the Projects data items so that when I select a project name in the Combo box, the same project name would seamlessly be selected in both tables.
Each table would populate with its own data based on the project selected.
Basically, I'd like to use the method illustrated in this Flash file:
http://www.mrexcel.com/wiki/index.php?n=ExcelWiki.SynchronizeTwoPivotTablesWithAComboBox
This method would have worked beautifully if it weren't for this reason:
Table 1: Project data is in the PAGE field
(single selection)
Table 2: Project data is in the ROW field (multi-selection)
If the Projects data was in the PAGE field in both tables, my code would look like this:
ActiveSheet.PivotTables("Table 1").PivotFields("Project").CurrentPage = _ActiveSheet.Range("X1").Value
ActiveSheet.PivotTables("Table 2").PivotFields("Project").CurrentPage = _ActiveSheet.Range("X1").Value
But no, because the ROW field is a multi-select one, I get this kind of code:
ActiveSheet.PivotTables("Table 1").PivotFields("Project").CurrentPage = _
ActiveSheet.Range("X1").Value
With ActiveSheet.PivotTables("Table 2").PivotFields("Project")
.PivotItems("Project 1").Visible = False
.PivotItems("Project 2").Visible = False
.PivotItems("Project 3").Visible = False
.PivotItems("Project 4").Visible = False
.PivotItems("Project 5").Visible = False
.PivotItems("Project 6").Visible = False
End With
End Sub
There are 98 project names. How can I work this out? Surely there is a way.