ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   linking pivot table selections (https://www.excelbanter.com/excel-programming/420475-linking-pivot-table-selections.html)

Rammy

linking pivot table selections
 
Using Excel 2007. I have two (or more) pivot tables that I want to be able to
link the selections made in one to another. I have the following code

Sub test()
Sheets("Sheet1").Select

Application.ScreenUpdating = False
Application.DisplayAlerts = False

Dim SPgField1 As String
Range("b1").Select
SPgField1 = Selection
Sheets("Sheet1").PivotTables("PivotTable2").PivotF ields("Field
1").CurrentPage = SPgField1

End Sub

The pivots are on sheet1
The 1st pivot table has 1 selection Field1.
The above code works if i am only making a single selection
However I need to be able to do multiple selections.
When this is done in the field b1 it shows the value Multiple Selections
This gets copied into the field1 on pivot table 2 - and overwrites the first
value of the selection list with Multiple Values. But doesnt do the correct
values

Any ideas much appreciated

Jim Thomlinson

linking pivot table selections
 
Check out this link...

http://www.contextures.com/excelfiles.html#Pivot
There are a number of different files here depending on exactly what you are
trying to do...
--
HTH...

Jim Thomlinson


"Rammy" wrote:

Using Excel 2007. I have two (or more) pivot tables that I want to be able to
link the selections made in one to another. I have the following code

Sub test()
Sheets("Sheet1").Select

Application.ScreenUpdating = False
Application.DisplayAlerts = False

Dim SPgField1 As String
Range("b1").Select
SPgField1 = Selection
Sheets("Sheet1").PivotTables("PivotTable2").PivotF ields("Field
1").CurrentPage = SPgField1

End Sub

The pivots are on sheet1
The 1st pivot table has 1 selection Field1.
The above code works if i am only making a single selection
However I need to be able to do multiple selections.
When this is done in the field b1 it shows the value Multiple Selections
This gets copied into the field1 on pivot table 2 - and overwrites the first
value of the selection list with Multiple Values. But doesnt do the correct
values

Any ideas much appreciated


Rammy

linking pivot table selections
 
Jim
Thanks for that. There was an example for linking selections on pivots - but
it doesnt work when making multiple value selections within on selection item.


"Jim Thomlinson" wrote:

Check out this link...

http://www.contextures.com/excelfiles.html#Pivot
There are a number of different files here depending on exactly what you are
trying to do...
--
HTH...

Jim Thomlinson


"Rammy" wrote:

Using Excel 2007. I have two (or more) pivot tables that I want to be able to
link the selections made in one to another. I have the following code

Sub test()
Sheets("Sheet1").Select

Application.ScreenUpdating = False
Application.DisplayAlerts = False

Dim SPgField1 As String
Range("b1").Select
SPgField1 = Selection
Sheets("Sheet1").PivotTables("PivotTable2").PivotF ields("Field
1").CurrentPage = SPgField1

End Sub

The pivots are on sheet1
The 1st pivot table has 1 selection Field1.
The above code works if i am only making a single selection
However I need to be able to do multiple selections.
When this is done in the field b1 it shows the value Multiple Selections
This gets copied into the field1 on pivot table 2 - and overwrites the first
value of the selection list with Multiple Values. But doesnt do the correct
values

Any ideas much appreciated



All times are GMT +1. The time now is 03:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com