Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Oct 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Y values in XY Scatter Chart? (2000/sp3)

    I feel like I'm missing the obvious... I have the following code to wipe-out and re-generate a chart (XY Scatter) based on ranges of data.. I have many columns of "X" points, and one column of "Y" points that I want to use for each set of "X" points. I can add all the "X" points, but don't know where to add the "Y" points? After the routine runs and I go check chart->sourcedata->series tab, all the "Y Values" are set to "={1}"

    thanks!
    ..dane

    <pre>Public Sub subPopulateChartDataSeries()

    Dim rngXPoints As Range
    Dim serSeries As Series

    ' clear the chart datapoints
    While Chart1.SeriesCollection.Count > 0
    Chart1.SeriesCollection(1).Delete
    Wend

    ' Add all the new datapoints
    For Each rngXPoints In Range("xpoints").Columns
    Set serSeries = Chart1.SeriesCollection.NewSeries
    serSeries.XValues = rngXPoints
    Next rngXPoints

    MsgBox "Number of series in chart: " & Chart1.SeriesCollection.Count


    End Sub
    </pre>


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Y values in XY Scatter Chart? (2000/sp3)

    You can use the Values property of the series to set the Y values, the same way you set the XValues property.

  3. #3
    2 Star Lounger
    Join Date
    Oct 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Y values in XY Scatter Chart? (2000/sp3)

    Du-OH!

    Like I said... missed the obvious.

    Thanks so much, Hans.

Posting Permissions

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