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

Filter Pivot Chart without Changing the Chart Format

Manster

Member
Hi Experts,

I have a problem regarding the pivot chart when filtering using a slicer. My problem is:
The chart format will change when I filter the data, for example, "Year". The "Target" line will change to the clustered column.

Therefore, I hope anyone can help me to maintain the line of "Target" if I filtered the chart, and at the same time, other data like A, B, C, D, E will maintain the clustered columns.

Please find an attachment (Combo Pivot Chart) for your kind attention.

Thank you.
 

Attachments

  • Combo Pivot Chart.xlsx
    20.9 KB · Views: 9
If you're happy to have a macro, in the sheet concerned's own code-module, something along the lines of:
Code:
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
On Error Resume Next
With ActiveSheet.ChartObjects(1).Chart
  .ChartType = xlColumnClustered
  .FullSeriesCollection("Target").ChartType = xlLine
End With
End Sub
 
If you're happy to have a macro, in the sheet concerned's own code-module, something along the lines of:
Code:
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
On Error Resume Next
With ActiveSheet.ChartObjects(1).Chart
  .ChartType = xlColumnClustered
  .FullSeriesCollection("Target").ChartType = xlLine
End With
End Sub
Yes!!! Of course, I am pleased about this. You save my day, Sir! I spent around 8 hours yesterday searching on YouTube and Google. Then, I decided to ask in this great forum for help. Thank you again, Sir! May God bless you.
 
If you're happy to have a macro, in the sheet concerned's own code-module, something along the lines of:
Code:
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
On Error Resume Next
With ActiveSheet.ChartObjects(1).Chart
  .ChartType = xlColumnClustered
  .FullSeriesCollection("Target").ChartType = xlLine
End With
End Sub
Hi Can you send the final file you have VBA code in it. I have simulated the same code in the attached file, but it was not work, I don't know why. The Pivot chart still change when I filtered.
 
Back
Top