Excel does not remember the correct color of inverted bar chart

kirvis

New Member
Joined
Dec 28, 2015
Messages
1
Hello,

I am creating a dashboard with a few bar charts, where the negative values have a different color then the positive values. To achieve this, I use the option "invert if negative" in the fill properties of the chart.

The problem is that when I save and re-open the file, the red color of the negative bars is put back to the default white-with-black-border.

Any idea on how I can make sure Excel remembers the correct color if the inverted bar charts?

Thanks,

Kirvis
Excel 2013
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hello and welcome to the Board

You could use a macro:

redgreen.JPG


Code:
Sub FormatChart()
Dim s As Series, i%


Set s = ActiveSheet.ChartObjects("Chart 2").Chart.FullSeriesCollection(1)
For i = 1 To s.Points.Count
    Select Case InStr(s.Points(i).DataLabel.Text, "; -")            ' is it negative?
        Case 0
            s.Points(i).Format.Fill.ForeColor.RGB = RGB(5, 200, 10)
            s.Points(i).DataLabel.Format.Fill.ForeColor.RGB = RGB(180, 230, 140)
        Case Is > 0
            s.Points(i).Format.Fill.ForeColor.RGB = RGB(240, 4, 8)
            s.Points(i).DataLabel.Format.Fill.ForeColor.RGB = RGB(240, 150, 140)
    End Select
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,647
Messages
6,126,005
Members
449,279
Latest member
Faraz5023

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