Pivot Table combination chart excel 2007

katie_1234

New Member
Joined
Feb 20, 2011
Messages
3
Hi,

I want to change one of the series in my pivot chart to a line graph. I want a macro that will change the series thats label contains the word Total to a line chart while the rest of the chart remains as a column. Is this possible?? :confused:


I really appreciate any suggestions as I am new to pivot tables and macros.:)
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Welcome to the Board!

Try this code on a worksheet that only contains a single Pivot Chart:
Code:
Sub ChangeTotalSeriesToLine()
 
    Dim lX As Long
 
    ActiveSheet.ChartObjects(1).Activate
    For lX = 1 To ActiveChart.SeriesCollection.Count
        If InStr(UCase(ActiveChart.SeriesCollection(lX).Name), "TOTAL") > 0 Then
            ActiveChart.SeriesCollection(lX).ChartType = xlLine
        End If
    Next
End Sub

See link in my sig on how to use this code.
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,292
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top