Data Change

The DataChange event occurs when certain properties of the PivotTable view are changed or when certain methods are executed from a PivotTable view. You can find out what sort of change occurred by evaluating the Reason argument. This argument contains a value from the PivotDataReasonEnum enumeration. For example, you can use Reason to determine if the user added or removed columns from the PivotTable view.

The event procedure in Hands-On 24-27 evaluates whether a change occurred in the PivotTable Last Name drop-down list. For all other changes in the PivotTable view, the procedure writes the Reason code to the Immediate window. To find out the meaning of the returned Reason codes, search for the PivotDataReasonEnum constant in the Object Browser.

0 0

Post a comment