Assigning array values to seriescollection

G

Gerardo

Hello,

I tried to add a series to a graph and it worked ok as long as the selected
range to build the array has less than 13 values.

What I do is get a range from user input. Then assign it to a range
variable. I create an array and start adding elements to keep the cummulative
from the given data. Then assigning this array to display as a cummulative
series and plot it with the original range.

What can I do to make it work after the 13th data input?

Set RngMensual = Application.InputBox("My prompt", "My Title", Type:=8)

For Each RngCelda In RngMensual
SngTotal = RngCelda.Value + SngTotal
ReDim Preserve SngAnual(i)
SngAnual(i) = SngTotal
i = i + 1
Next RngCelda

Charts.Add
With ActiveChart
.ChartType = xlLineMarkers
.SeriesCollection.NewSeries
'.SeriesCollection(1).Values = SngAnual
.SetSourceData Source:=RngAnual
.SeriesCollection(1).Select
With Selection.Border
.ColorIndex = 11
.Weight = xlMedium
.LineStyle = xlContinuous
End With
 

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