PDA

View Full Version : Solved: Convert chart series into values



Shazam
09-29-2006, 01:49 PM
Hi Everyone,


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

Prasad_Joshi
09-30-2006, 02:53 AM
Please write details, what actually you want to do ?

Prasad Joshi
:think:

Shazam
09-30-2006, 09:23 AM
I believed I found what I was looking for. This code below will convert my chart series into arrays values.




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