Consulting

Results 1 to 10 of 10

Thread: Chartobjectsd and SeriesCollection

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Oct 2018
    Posts
    43
    Location

    Chartobjectsd and SeriesCollection

    Hi Everyone,

    The question might be seemed silly bit I couldn't find a way to figure something.

    I am trying to update the SeriesCollection of a chart within a Chart Sheet.

    Usually, if the chart is a regular worksheet, I use the following code:

    Sub Test()
    
    Dim Sh As Worksheet
    Dim Cht As ChartObjects
    Dim Ser As Series
    
    
    Set Sh = Worksheets("MC-40 Graph")
    Set Cht = Sh.ChartObjects("MC-40 Graph").Chart
    
    
    
    
        For Each Ser In Cht.SeriesCollection
            Ser.XValues = Range(Split(Ser.Formula, ",")(1)).Offset(, 1)
            Ser.Values = Range(Split(Ser.Formula, ",")(2)).Offset(, 1)
        Next
    
    
    End Sub
    Unfortunately it doesn't work my chart sheet.
    Could you help me on this issue?


    Thanks a lot
    Last edited by Edmond; 01-28-2019 at 03:13 PM.
    Edmond

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •