N
neowok
I have the floowing pivotchart (see attached)
what I want to do is colour these bars based on the catagory at th
bottom using code. i.e. if catagory is Comms & SCADA then colour it x
colour.
now sometimes there is 6 catagories, sometimes 7 (but never more tha
7) so what i need also, is to put that code inside a loop which say
something like for column 1 to last, if the catagory for this column
"comms & SCADA" then colour it xx colour.
ive got as far as colour the bar using this code for each
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).Points(1).Select
ActiveChart.SeriesCollection(1).Points(1).ApplyDataLabel
ShowValue:=True
With Selection.Interior
.ColorIndex = 33
End With
however the catagories are not always in the same order (and ther
arent always the same number) so at the moment im having to manuall
add the code and colours for each of the bars. what i want to do i
have code that will colour the bars in based on what the delivery grou
is. there are 7 set groups which will not change and as you can se
from the graph, this weekthere is only 6 listed.
basically i need the code which says
from <first bar> to <last bar> do
if bar is for delivery group "xxxx" then set colour to xx
if bar is for delivery group "yyyy" then set colour to yy
etc etc with one if for each of the 7 groups.
Thank
Attachment filename: pivot1.jpg
Download attachment: http://www.excelforum.com/attachment.php?postid=58060
what I want to do is colour these bars based on the catagory at th
bottom using code. i.e. if catagory is Comms & SCADA then colour it x
colour.
now sometimes there is 6 catagories, sometimes 7 (but never more tha
7) so what i need also, is to put that code inside a loop which say
something like for column 1 to last, if the catagory for this column
"comms & SCADA" then colour it xx colour.
ive got as far as colour the bar using this code for each
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).Points(1).Select
ActiveChart.SeriesCollection(1).Points(1).ApplyDataLabel
ShowValue:=True
With Selection.Interior
.ColorIndex = 33
End With
however the catagories are not always in the same order (and ther
arent always the same number) so at the moment im having to manuall
add the code and colours for each of the bars. what i want to do i
have code that will colour the bars in based on what the delivery grou
is. there are 7 set groups which will not change and as you can se
from the graph, this weekthere is only 6 listed.
basically i need the code which says
from <first bar> to <last bar> do
if bar is for delivery group "xxxx" then set colour to xx
if bar is for delivery group "yyyy" then set colour to yy
etc etc with one if for each of the 7 groups.
Thank
Attachment filename: pivot1.jpg
Download attachment: http://www.excelforum.com/attachment.php?postid=58060