View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Vacation's Over Vacation's Over is offline
external usenet poster
 
Posts: 279
Default Change colour of bars/lines in charts when data in rows/colums

I believe that your main goal is to have a unique color for a charted
"entity" and it can work. Safeway is always RED. the series.name should do
this as long as the user charts with Safeway showing up in a legend (as a
test, you do not need legend to be visible)

are you saying that if you block a range and chart it by col and then
transpose it and block and chart by row that the names shown in the legend
are still the same but that your code does not work?

I think that the issue you have is not in the posted code.

try stepping through the code in debugger with a watch on the s.name
or
insert a msgbox:

For Each s In .SeriesCollection
seriesname = s.Name

msgbox seriesname <=====insert this line to see what's going on

STOP THE PRESSES===============
just reread all posts:
What do you mean by "category name" for the Point

I thought you were controlling series color not point color & what is a
category?


"RodP" wrote:

Hiya,

The users are pretty clued up on the creation of charts. Some charts need
to be charted by column aswell as by row - hence I need to cater for both
eventualities.

At the moment the code is rather specific as I'm not yet worrying about pie
charts etc. I'll come to that when I get this bit working.

All the charts so far have been created in quite a logical way (ie all data
is blocked together like in my example) although I didn't think that that
would have made any difference regarding my coding. Using a For each...next
loop, I'm able to cycle through all the bars when it's' by column' and 'by
row', it's just that I don't know how to find out what category the bar /
data point lies at when the data is plotted 'by column'. When 'by row' it's
simply the series name (s.name in my code).

Using said loop, I'm able to display the values for each point. Having
managed to do this, I thought it would be just as easy to pull out the
category also - but it's prooving more difficult by the sounds of it!

I'd be interested to know a little more about the problems you're talking
about - is my thought / idea a total no go as I should be approaching this
problem in another way? Any suggestions would be greatly welcomed!

Many thanks

RodP