Smoothing a chart line using VBA

G

Guest

I have a macro that creates a Line Column on 2 Axes Chart and holds 3 sets of
data, the first 2 represented by columns, the third by a line. I have been
unsuccessfully trying to get the line to smooth between data points.

I have tried code such as:

With ActiveChart.LineGroups(1)
.Smooth = True
End With

Which gives me the error: "Object doesn't support this property or method"

or:

Dim Ser As Series
Set Ser = Charts("Attendance Roster Chart").SeriesCollection("Attendance
Pivot")
With Ser
.Smooth = True
.Border.Weight = xlThick
End With

(The chart name sheet is "Attendance Roster Chart", and the series is
"Attendance Pivot")

Which gives me the error message "Unable to get the SeriesCollection
property of the chart class"

I'm getting frustrated. Any ideas?

Thanks in advance
 
G

Guest

Just to clarify, are you tring to do a polynomial regression of your source
data or to add a trend line, or to create a moving average, or just to change
the chart type to smooth line? Other than changing the chart type you have to
select a smoothing algrythm. I recommend looking at the trend function. I
have used it with quite a bit of success. If it is just a chart type issue
then just recording a macro of changing the chart type and analyzing what is
recorded should cover things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top