#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default pivot table filter

I have two independent pivot tables. Each has 3 filters.

I would like to change the filters of the second pivot table based on the
values in the first pivot table's filters.

Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 434
Default pivot table filter

hi, samuel !

I have two independent pivot tables. Each has 3 filters.
I would like to change the filters of the second pivot table based on the values in the first pivot table's filters.
Is this possible?


I can't "see" your layout, but try using vba/code in the '_change' event (in your worksheet/s or workbook object)
to make "other" filter/s match the (current) "changing-cell-filter" ;)

hth,
hector.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default pivot table filter

I recorded a macro and simulated what I want to happen automatically.

Obviously PivotTable5 is what I want to change automatically based on
PivotTable 4

ActiveSheet.PivotTables("PivotTable4").PivotFields ("Facility").ClearAllFilters

ActiveSheet.PivotTables("PivotTable4").PivotFields ("Facility").CurrentPage = _
"MCMC"

ActiveSheet.PivotTables("PivotTable5").PivotFields ("Facility").ClearAllFilters

ActiveSheet.PivotTables("PivotTable5").PivotFields ("Facility").CurrentPage = _
"MCMC"


"Héctor Miguel" wrote:

hi, samuel !

I have two independent pivot tables. Each has 3 filters.
I would like to change the filters of the second pivot table based on the values in the first pivot table's filters.
Is this possible?


I can't "see" your layout, but try using vba/code in the '_change' event (in your worksheet/s or workbook object)
to make "other" filter/s match the (current) "changing-cell-filter" ;)

hth,
hector.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 434
Default pivot table filter

hi, samuel !

I recorded a macro and simulated what I want to happen automatically.
Obviously PivotTable5 is what I want to change automatically based on PivotTable 4

ActiveSheet.PivotTables("PivotTable4").PivotFields ("Facility").ClearAllFilters
ActiveSheet.PivotTables("PivotTable4").PivotFields ("Facility").CurrentPage = "MCMC"
ActiveSheet.PivotTables("PivotTable5").PivotFields ("Facility").ClearAllFilters
ActiveSheet.PivotTables("PivotTable5").PivotFields ("Facility").CurrentPage = "MCMC"


try with your worksheet events code module and something like the following:

Private Sub Worksheet_Calculate()
Me.PivotTables("PivotTable5").PivotFields("Facilit y").CurrentPage = _
CStr(Me.PivotTables("PivotTable4").PivotFields("Fa cility").CurrentPage.Value)
End Sub

hth,
hector.

__ OP __
I have two independent pivot tables. Each has 3 filters.
I would like to change the filters of the second pivot table based on the values in the first pivot table's filters.
Is this possible?


I can't "see" your layout, but try using vba/code in the '_change' event (in your worksheet/s or workbook object)
to make "other" filter/s match the (current) "changing-cell-filter" ;)



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default pivot table filter

Sorry, I'm new to VBA, and I'm not following your suggestion.

"Héctor Miguel" wrote:

hi, samuel !

I recorded a macro and simulated what I want to happen automatically.
Obviously PivotTable5 is what I want to change automatically based on PivotTable 4

ActiveSheet.PivotTables("PivotTable4").PivotFields ("Facility").ClearAllFilters
ActiveSheet.PivotTables("PivotTable4").PivotFields ("Facility").CurrentPage = "MCMC"
ActiveSheet.PivotTables("PivotTable5").PivotFields ("Facility").ClearAllFilters
ActiveSheet.PivotTables("PivotTable5").PivotFields ("Facility").CurrentPage = "MCMC"


try with your worksheet events code module and something like the following:

Private Sub Worksheet_Calculate()
Me.PivotTables("PivotTable5").PivotFields("Facilit y").CurrentPage = _
CStr(Me.PivotTables("PivotTable4").PivotFields("Fa cility").CurrentPage.Value)
End Sub

hth,
hector.

__ OP __
I have two independent pivot tables. Each has 3 filters.
I would like to change the filters of the second pivot table based on the values in the first pivot table's filters.
Is this possible?

I can't "see" your layout, but try using vba/code in the '_change' event (in your worksheet/s or workbook object)
to make "other" filter/s match the (current) "changing-cell-filter" ;)






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 434
Default pivot table filter

hi, samuel !

Sorry, I'm new to VBA, and I'm not following your suggestion.


- right-click on your worksheet tab/name (where your PT resides) and choose "view code"

- copy/paste the proposed code into "that" code module window:
(if necessary, replace whatever lines on it, assuming you are not using any other code)

Private Sub Worksheet_Calculate()
Me.PivotTables("PivotTable5").PivotFields("Facilit y").CurrentPage = _
CStr(Me.PivotTables("PivotTable4").PivotFields("Fa cility").CurrentPage.Value)
End Sub

give it a try by changing your PT4 field ("Facility") and see what happens on your PT5

hth,
hector.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter lines with Pivot table and non pivot table columns Grover Charts and Charting in Excel 4 September 28th 07 03:16 AM
Filter lines with Pivot table and non Pivot table columns Grover Excel Discussion (Misc queries) 1 September 26th 07 12:48 AM
Filter lines containing pivot table and non pivot table data Grover Excel Worksheet Functions 0 September 24th 07 07:20 PM
Pivot Table Value Filter T. Jenkins Excel Discussion (Misc queries) 1 December 6th 06 04:09 PM
Pivot Table - Filter Kevin Excel Discussion (Misc queries) 5 September 9th 06 09:32 PM


All times are GMT +1. The time now is 06:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"