Run come when value of a PivotTable flter changes

Sandra Smith
Sandra Smith used Ask the Experts™
I have a worksheet that contains a pivotable where the users can select one or more year to view.  However, there is some automatica analsysi that needs to run when the year changes, but am not sure how to tell that when cell D12 (where the year filter is located) changes, run the FTEAnalysis code.  On do not want it t run when anything else changes on the worksheet.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2011
Top Expert 2011
Have you tried the Worksheet_Change event? Right-click the tab of the sheet with the pivot, choose View code then paste this in:

Private Sub Worksheet_Change(ByVal Target As Range)
if not intersect(target, range("D12")) is nothing then
' call your code here
End If
End Sub

Open in new window

Sandra SmithRetired


That worked, thank you.


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial