View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Mark Bigelow Mark Bigelow is offline
external usenet poster
 
Posts: 55
Default How do I get Pivot filter change event to fire?

Hi Claude,

I have a macro that does just what you are looking for, in a report I
run here at work. Here's what I do:

In the pivotTable_Change event, you'll have to loop through each of the
slave pivotTables and uncheck all of the filtered items, except the one
that matches the one selected in the parent PivotTable. This done this
way:

With Sheets("Dump
Sheet").PivotTables("PivotTable3").PivotFields("PO SWeek")
On Error Resume Next
.PivotItems(Range("B2").Value).Visible = True
For Each itm In .PivotItems
If InStr(strDate, itm) 0 Then
itm.Visible = True
Else
itm.Visible = False
End If
Next itm
On Error GoTo 0
End With

It's certainly not the most elegant way to do it, but it works for me.
If somebody knows of a better way, please post it!

Mark
---
Mark Bigelow
mjbigelow at hotmail dot com
http://hm.imperialoiltx.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!