Hi Guys
Ive got a workbook with 5 sheets, all having at least 3 charts on each sheet. Im writing a bit code to change the color of each series point, depending on the name of the point.
Each point will always end in either Q1, Q2, Q3 or Q4.
Ive pretty much got the code, except I cant get the syntax for the variable 'ptname':
Any suggestions greatly appreciated!
Thanks
Jamie
Ive got a workbook with 5 sheets, all having at least 3 charts on each sheet. Im writing a bit code to change the color of each series point, depending on the name of the point.
Each point will always end in either Q1, Q2, Q3 or Q4.
Ive pretty much got the code, except I cant get the syntax for the variable 'ptname':
Code:
For Each sh In ActiveWorkbook.Worksheets
For Each ch In c.ChartObjects
For Each sc In p.Chart.SeriesCollection
For Each pt In m.Points
ptname = WorksheetFunction.Index(sh.ch.sc.XValues, pt)
Select Case Right(ptname, 2)
Case Is = "Q1"
'color for Q1
Case Is = "Q2"
'color for Q2
Case Is = "Q3"
'color for Q3
Case Is = "Q4"
'color for Q4
End Select
Next pt
Next sc
Next ch
Next sh
Any suggestions greatly appreciated!
Thanks
Jamie