捕获Excel数据透视表刷新事件

时间:2022-02-26 00:00:11

Is there an event corresponding to the data refresh of a pivot table? I have found the

是否存在与数据透视表的数据刷新相对应的事件?我找到了

    worksheet_pivottableupdate
event but this seems to be called everytime I change filters or manipulate the pivottable (which is quite frequently with my macros). What I need is just to capture when the underlying data is updated. Any way to do this?

1 个解决方案

#1


2  

One way to tackle this is to use the pivottableupdate event, and combine it with checking that the following pivot-table property has changed.

解决此问题的一种方法是使用pivottableupdate事件,并将其与检查以下数据透视表属性已更改相结合。

PivotTables("PivotTable1").RefreshDate

See http://msdn.microsoft.com/en-us/library/ff834610(v=office.14).aspx for more information on the RefreshDate property.

有关RefreshDate属性的更多信息,请参见http://msdn.microsoft.com/en-us/library/ff834610(v=office.14).aspx。

#1


2  

One way to tackle this is to use the pivottableupdate event, and combine it with checking that the following pivot-table property has changed.

解决此问题的一种方法是使用pivottableupdate事件,并将其与检查以下数据透视表属性已更改相结合。

PivotTables("PivotTable1").RefreshDate

See http://msdn.microsoft.com/en-us/library/ff834610(v=office.14).aspx for more information on the RefreshDate property.

有关RefreshDate属性的更多信息,请参见http://msdn.microsoft.com/en-us/library/ff834610(v=office.14).aspx。