Chart: unique colour for single bar based on cell value

Gem1979

New Member
Joined
Aug 28, 2014
Messages
19
Hi, hoping someone may be able to help or advise on the correct search term I should use to find out how to do the following. I have three simple column charts based on tables, all formatted in the same colour.
The horizontal axis labels are hidden on purpose.
I would like to be able to pick out one column on each chart for the same axis label. Ideally from a cell value or dropdown that another used can edit. So all the columns would be dark blue except for the one axis label selected. I can do this manually (as I did in the examples below) but have 3 charts that would each need amending 29 times on a regular basis. Any suggestions much appreciated. I hope I have uploaded the charts correctly as the first time I've asked a chart related question.
Capture.PNG
 

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,703
Platform
  1. Windows
Hello,

have assumed the graphs are named Chart 1, Chart 2 and Chart 3 and the required column is in cell D1.

How is this for a start?

VBA Code:
Sub CHANGE_ONE_GRAPH_COLOUR()
    For MY_CHART = 1 To 3
        ActiveSheet.ChartObjects("Chart " & MY_CHART).Activate
        ActiveChart.SeriesCollection(1).Interior.ColorIndex = 11
        ActiveChart.SeriesCollection(1).Points(Range("D1").Value).Interior.ColorIndex = 34
    Next MY_CHART
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,127,294
Messages
5,623,829
Members
415,993
Latest member
Nawlins

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
Top