• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Trigger Macro On changing a filter of a piot table

Hi Retnec,


you can use a simple worksheet_change event to find if the filter value is changed, and call the required macro.


example:


Code:
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("$C$4")) Is Nothing Then

MsgBox "You can call your macro function here"

'Use macro code or Call macro here..

End If

End Sub

Here Range("$C$4") is the cell where you have the pivot filter..


Hope this helps.


Regards,

Prasad DN
 
You could also use this in the worksheet module

[pre]
Code:
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
code here
End Sub
[/pre]
This fires with all changes to the pivot table however.
 
Back
Top