Hi,

I've hit a brick wall and can't seem to work out what I'm doing wrong..

I have a need to create some pie charts. Over the course of the year, the data series will have 12 items which needed to be charted. The same report is also produced on a monthly basis, and not all 12 items will be present every month.

My manager wants the formatting of each slice to be the same from month to month, that is, every time the 'Apple' data point is displayed, it is coloured with the same colour and/or fill pattern.

I understand that the XValues array within the series collection for the chart will contain the label of the data point (in this example "Apple") so what I think I want to do is to use a 'select case' based on the XValue for each element in the series collection and then adjust the point color etc based on the XValue returned.

Currently, the following code fragment fails at the SeriesCollection(1).XValues(i) line with a "Wrong number of arguments or invalid property assignment" error.

HighNum & LowNum are correctly set and I've managed to get the data label out of XValues once, during initial testing to see if this is a viable option, but unfortunately deleted the working code fragment in my enthusiasm to develop the complete routine and I can't remember how I got it to work

I don't know what I'm doing wrong and can't see the wood from the trees. Can anyone point me in the right direction?

   dim pnt As Point

    With Charts("Pie")
       
        HighNum = UBound(.SeriesCollection(1).XValues)
        LowNum = LBound(.SeriesCollection(1).XValues)
         
        For i = LowNum To HignNum
        
         Set pnt = .SeriesCollection(1).Points(i)
            Select Case .SeriesCollection(1).XValues(i)
                Case "Apples"        ' set to green
                    pnt.Interior.Color = RGB(0, 255, 0)
            End Select
        Next i
Thanks for your help
Trevor