Does anyone know the PivotTable Refresh Event?

J

JohnD'Elia

Does anyone know the event that happens when a PivotTable is refreshed
I have a chart that is created from a PivotTable when the use
refreshes the PivotTable I lose all my chart formatting. I'v
discovered that this is a known Microsoft issu
(http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q215904).

What I want to do is trap the refresh event and reapply my char
formatting once it is completed. I've seen an AfterRefresh event bu
that seems to only work with query data not when the user manuall
selects the refresh.

Thanks,
-John D'Eli
 
D

Debra Dalgleish

The Chart_Calculate event should work if the chart sheet is being refreshed:

'==========================
Private Sub Chart_Calculate()
With Charts("Chart1").SeriesCollection(1).Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
End Sub
'====================

Or use the Pivot Update event on the sheet that contains the pivot table:
'=======================
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
With Charts("Chart1").SeriesCollection(1).Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
End Sub
'=================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top