Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Excel: Looping through all chart series of all charts on a worksheet

Avatar of skillilea
skillilea asked on
Microsoft ExcelSpreadsheetsVB Script
15 Comments1 Solution1032 ViewsLast Modified:
I need to be able to loop through all my charts (without selecting them) and modify the chart series value.  I can't seem to get at the value or xvalues property of the series.  What am I doing wrong?

Thanks experts!
Private Sub reset_chartseries()    
    Dim c As ChartObject
    Dim n As Integer
    Dim cs As SeriesCollection

    For Each c In rws.ChartObjects
        Set c = rws.ChartObjects(c.Name)
            For n = c.Chart.SeriesCollection.Count To 1 Step -1
                Set cs = c.Chart.SeriesCollection
                    Debug.Print cs(n).Values

'here is where I will do an if statement
' if value = "[0]" then xvalue ="reports!named range"

End Sub