Chart Column Fill

mikeymay

Well-known Member
Joined
Jan 17, 2006
Messages
1,600
Office Version
  1. 365
Platform
  1. Windows
Is it possible using VBA to apply gradient colour changes to a chart column?

The column has a 2 colours ranging from 0% to 100%

What I want to acheive is to apply a 3rd colour when then column value breaches a value.

E.g.
Value to check against is 64
Value of the column to apply colours to is 100

1656746049894.png


0% to 64% will be the colours
65% to 100% will be the third colour

1656746099689.png
1656746114066.png


When I have recorded the code tells me nothing on how to 'code' this
VBA Code:
ActiveSheet.ChartObjects("chtBFSpent").Activate
ActiveChart.FullSeriesCollection(2).Select
ActiveChart.FullSeriesCollection(2).Points(1).Select
Selection.Format.Fill.Visible = msoTrue
Selection.Format.Fill.Visible = msoTrue
Selection.Format.Fill.Visible = msoTrue
Selection.Format.Fill.Visible = msoTrue
TIA
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Another take on this would be use a stacked chart. And have the parts coloured in differently.
You would need to do some calculations to create the elements of the stacked series.
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,954
Members
449,198
Latest member
MhammadishaqKhan

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