This code below will convert your chart values into array vaules. How can it be modified so the code could go through every worksheet in the workbook and covert into array values?
I know it has something to do with in these lines but I can't get it to work.
Code:
Sub Convert_Into_Array_Values()
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
I know it has something to do with in these lines but I can't get it to work.
Code:
For Each shtTemp In ThisWorkbook.Worksheets
For Each chtTemp In shtTemp.ChartObjects