changing all bars within a bar graph to same color at once

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to change to the same color on all the bars within a chart at
the same time?
 
I assume you have a chart with more than one data series?
Experimentation seems to suggest the answer is NO, but of course all (many)
things are possible with VBA

This will make them all aqua

Sub MakeColor()
ActiveSheet.ChartObjects("Chart 1").Activate
myCount = ActiveChart.SeriesCollection.Count
For j = 1 To myCount
ActiveChart.SeriesCollection(j).Select
With Selection.Interior
.ColorIndex = 8
.Pattern = xlSolid
End With
Next j
End Sub


best wishes
 
Thanks - I'll try that!

Bernard Liengme said:
I assume you have a chart with more than one data series?
Experimentation seems to suggest the answer is NO, but of course all (many)
things are possible with VBA

This will make them all aqua

Sub MakeColor()
ActiveSheet.ChartObjects("Chart 1").Activate
myCount = ActiveChart.SeriesCollection.Count
For j = 1 To myCount
ActiveChart.SeriesCollection(j).Select
With Selection.Interior
.ColorIndex = 8
.Pattern = xlSolid
End With
Next j
End Sub


best wishes
 
Or change one, then without doing anything else, select the next series and press F4
to repeat, then continue with the select + F4 sequence until everything is changed.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
Back
Top