Consulting

Results 1 to 3 of 3

Thread: Solved: Convert chart series into values

  1. #1
    VBAX Expert Shazam's Avatar
    Joined
    Sep 2005
    Posts
    530
    Location

    Solved: Convert chart series into values

    Hi Everyone,


    I would like a vba code that will convert my chart series into values. This will be a daily process.
    SHAZAM!

  2. #2
    Please write details, what actually you want to do ?

    Prasad Joshi

  3. #3
    VBAX Expert Shazam's Avatar
    Joined
    Sep 2005
    Posts
    530
    Location
    I believed I found what I was looking for. This code below will convert my chart series into arrays values.



    [vba]
    Sub Convert_Chart_Series_Into_Arrays()
    Dim mySeries As Series
    Dim sChtName As String
    ''' Make sure a chart is selected
    On Error Resume Next
    sChtName = ActiveChart.Name
    If Err.Number <> 0 Then
    MsgBox "This functionality is available only for charts " _
    & "or chart objects"
    Exit Sub
    End If
    If TypeName(Selection) = "ChartObject" Then
    ActiveSheet.ChartObjects(Selection.Name).Activate
    End If
    On Error GoTo 0
    ''' Loop through all series in active chart
    For Each mySeries In ActiveChart.SeriesCollection
    '''' Convert X and Y Values to arrays of values
    mySeries.XValues = mySeries.XValues
    mySeries.Values = mySeries.Values
    mySeries.Name = mySeries.Name
    Next mySeries
    End Sub
    [/vba]
    SHAZAM!

Posting Permissions

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