• 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.

Selected Pivot Table updates based on Calculated Cell

Hi all,
Pretty certain this is a fairly simple one kicking my backside!

Basically if a cell changes I want named pivot tables to refresh. I thought I had it working as the refresh triggered, but sadly got caught in a refresh loop.

This is what I used :

On the sheet that changes:
Code:
Private Sub Worksheet_Calculate()

If Range("A58").Value <> PrevVal Then

PT_REFRESH

End If

End Sub

In module:
Code:
Public PrevVal As Variant


Sub PT_REFRESH()

Worksheets("1").PivotTables("PT_refresh1").RefreshTable

End Sub



Any help on this issue much appreciated..

Thanks,


-CL.
 
Last edited:
You probably need, in the Worksheet_Calculate sub:
application.enableevents=false
before the line:
PT_REFRESH
and
application.enableevents=true
after that line.
 
Back
Top