Hi,
I want to create charts in Excel and I have different matrices (ranges).
Range("K2:P14").Select
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("Plan2").Range("K2:P14")
ActiveChart.Location Where:=xlLocationAsObject, Name:="Plan2"
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(1).XValues = "=Plan2!R3C10:R16C10"
ActiveChart.SeriesCollection(2).XValues = "=Plan2!R3C10:R16C10"
ActiveChart.SeriesCollection(3).XValues = "=Plan2!R3C10:R16C10"
ActiveChart.SeriesCollection(4).XValues = "=Plan2!R3C10:R16C10"
ActiveChart.SeriesCollection(5).XValues = "=Plan2!R3C10:R16C10"
ActiveChart.SeriesCollection(6).XValues = "=Plan2!R3C10:R16C10"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Geral"
End With
That´s the routine to create one chart, but I need to create a lot more (using the command for next). To work with "for", I need to use Cells( i , j ).
I´ve tried Range(Cells(x,x) , Cells(y,y)).
Example:
ActiveChart.SetSourceData Source:=Plan2.Range(Cells(j * 15 + 2, colun + 2), Cells(j * 15 + 14, colun + anos + 1))
But that doesn´t work, it´s not looping.
Anyone can help?