Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2011

    Unanswered: Excel pivot table data change event

    Hi all,
    I have an excel workbook with 1 pivot table and 1 chart. In the chart I have set 3 fields as columns chart and one as line type. But whenever I change the filters from no data(when filter values mismatch) to data (matching filter values) the formatting goes and I can see only columns for all fields.

    How can I keep the formatting(chart types) even when filter conditions change?

    I have excel 2010. I am not finding worksheet_change event in the workbook and I tried typing it but the event is not running. Also I used Workbook_SheetPivotTableAfterValueChange, this is running multiple times.
    I used the following codes.

    Private Sub Workbook_SheetPivotTableAfterValueChange(ByVal Sh As Object, ByVal TargetPivotTable As PivotTable, ByVal TargetRange As Range)
    Call modulemacro1
    End Sub

    Private Sub worksheet_change(ByVal Target As Range)
    Call modulemacro1
    End Sub

    Can anybody help me so that my chart formatting does not change even after changing the filter conditions.....

  2. #2
    Join Date
    Jun 2012

    Re:Excel pivot table data change event


    I had also got stuck with same problem (though in Excel 2007).

    But instead of calling worksheet_change event I have used the Worksheet_SelectionChange event of the worksheet and it worked.

    So, I think you can also use the same event.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts