Changing the colour of a bar on a chart

G

Graham Whitehead

I have created a column chart and am now trying to change the colour of one
of the bars. Here is the code I am using:

With chtChart
ActiveChart.SeriesCollection(1).Points(2).Select
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
End With

But to an avail. can anyone see what is wrong with it?
 
G

Guest

try

ActiveSheet.ChartObjects(1).Activate
With chtChart
ActiveChart.SeriesCollection(1).Points(2).Select
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
End With
 
Joined
Jun 14, 2006
Messages
27
Reaction score
0
I may be looking at this the wrong way but you can change the colour of a bar by double clicking on the colour bar you want to change and the colour pallete option appears

Regards

Zoddy
 
P

Peter T

That code should work though "With chtChart..End With" does nothing in your
useage.
You don't need to select the chart

With ActiveSheet.ChartObjects(1).Chart
.SeriesCollection(1).Points(2).Interior.ColorIndex = 3
End With

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top