Hello,
I'm try to figure out how to find what the source data range a chart refers to is, but there isn't an obvious property or method to get this. Does anyone know how to do it? There is a Chart.SetSourceData but no Chart.GetSourceData.
Thanks,
Taylour
I'm try to figure out how to find what the source data range a chart refers to is, but there isn't an obvious property or method to get this. Does anyone know how to do it? There is a Chart.SetSourceData but no Chart.GetSourceData.
Thanks,
Taylour
Code:
Sub test()
Dim cht As Chart, rngSourceData As Range
For Each cht In ActiveSheet.Charts
'This method doesn't exist.
'Set rngSourceData = cht.GetSourceData
If Not (Intersect(rngSourceData, Range("A1:M8")) Is Nothing) Then
cht.Delete
End If
Next cht
End Sub