Annoying Pivot Chart default colour help please

Eisasuarez

Well-known Member
Joined
Mar 23, 2012
Messages
653
Hi

i have created several pivot charts for multiple sheets

I have named each chart appropriately. Ive just realised that when i change the slicer option, aome of my chart colour defaults back to the standard colour and that’s annoying

So what im now trying to do is set up some code to change the chart colours to my colours when the pivot tables on that sheet updates

ive tried recording a macro to give me the code that changes the chart colour and code but for some reason its not giving me any code

can you please help me change the colours to my barcharts to the colour i want

many thanks
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi

I managed to get some code but I cant seem to get it to work

Im trying to set the chart series colour to a preset gradient fill in excel 2013

Some of my charts have 2 series and some have 1 (there could be times that are no data)

This is what im trying to do

Code:
Sub Macro3()
    
    Dim ws As Worksheet
    Set ws = Worksheets("Dashboard Schedule")
    
    ws.ChartObjects("Chart 60").Activate
    
on error resume next
ActiveChart.FullSeriesCollection(1).Select
    Selection.Format.Fill.Visible = msoTrue
    
    With ActiveChart.FullSeriesCollection.Fill
        .Visible = True
        .PresetGradient "From Top Left Corner, "Bottom Spotlight - Accent 6"
    End With
    
    ActiveChart.FullSeriesCollection(1).DataLabels.Select
    With Selection.Format.TextFrame2.TextRange.Font
        .NameComplexScript = "Century Gothic"
        .NameFarEast = "Century Gothic"
        .Name = "Century Gothic"
    End With
    Selection.Format.TextFrame2.TextRange.Font.Bold = msoTrue
on error goto 0

    Range("E46").Select
End Sub
 
Upvote 0
Hi this is the code that works

Can someone please help me amend this so I can have the series color change to the preset gradient fill (Direction is "From Top Left Corner" and Color is "Bottom Spotlight - Accent 6"

Thank you

Code:
Sub ChangeChart3Colour()
Dim ws As Worksheet
Set ws = Worksheets("Dashboard Schedule")
    ws.ChartObjects("Chart 63").Activate
    
    On Error GoTo ExitMe:
        ActiveChart.FullSeriesCollection(1).Select
        ActiveChart.FullSeriesCollection(1).Points(1).Select
        With Selection.Format.Fill
            .Visible = msoTrue
            .ForeColor.ObjectThemeColor = msoThemeColorAccent2
            .ForeColor.TintAndShade = 0
            .ForeColor.Brightness = 0
            .Transparency = 0
            .Solid
        End With
        ActiveChart.FullSeriesCollection(1).Points(1).ApplyDataLabels
        ActiveChart.FullSeriesCollection(1).DataLabels.Select
        With Selection.Format.TextFrame2.TextRange.Font
            .NameComplexScript = "Century Gothic"
            .NameFarEast = "Century Gothic"
            .Name = "Century Gothic"
        End With
        Selection.Format.TextFrame2.TextRange.Font.Bold = msoTrue
        With Selection.Format.TextFrame2.TextRange.Font.Fill
            .Visible = msoTrue
            .ForeColor.ObjectThemeColor = msoThemeColorText1
            .ForeColor.TintAndShade = 0
            .ForeColor.Brightness = 0.349999994
            .Transparency = 0
            .Solid
        End With
ExitMe:
Exit Sub
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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