How can I check to see if a seriescollection has a trendline so that I can delete it? This is the code I have now:
'-----------------------------------------
On Error Resume Next
For Each a In Sheets("Chart").ChartObjects
For Each b In a.Chart.SeriesCollection
For Each c In b.Trendlines
c.Delete
Next c
Next b
Next a
On Error GoTo 0
'-----------------------------------------
This works, but I had to trap the errors because I couldn't figure out how to check for the existance of trendline without generating an error. What is the proper way to check to see if a trendline exists?
'-----------------------------------------
On Error Resume Next
For Each a In Sheets("Chart").ChartObjects
For Each b In a.Chart.SeriesCollection
For Each c In b.Trendlines
c.Delete
Next c
Next b
Next a
On Error GoTo 0
'-----------------------------------------
This works, but I had to trap the errors because I couldn't figure out how to check for the existance of trendline without generating an error. What is the proper way to check to see if a trendline exists?