stef
-
4 avril 2001 à 19:28
cs_EBArtSoft
Messages postés4525Date d'inscriptiondimanche 29 septembre 2002StatutModérateurDernière intervention22 avril 2019
-
7 août 2007 à 09:23
bonjour,c'est l'histoire d'un mec qu'a 1 pb:
débutant VBA, je cherche sur excel à creer autant de graph que j'ai de ligne de donnée, mais je ne trouve pas comment incrementer la plage de donnée dans la macro suivant:
j'arrive juste à boucler sur la même plage, à l'aide!!!!!!!
Evidement j'obtient x fois le même graph.
Dim x As Integer
Sheets("Feuil1").Select Range("A5:A20").Select
For x = 5 To 20
Charts.Add
ActiveChart.ChartType = xl3DColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Feuil1").Range("a5:m5"), PlotBy:=xlRows
ActiveChart.SeriesCollection(1).XValues = "=Feuil1!R3C2:R3C13"
ActiveChart.SeriesCollection(1).Name = "=Feuil1!R5C1"
ActiveChart.Location Where:=xlLocationAsObject, Name:="Feuil2"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "POLYESTER METALLISE "
.Axes(xlCategory).HasTitle = True
.Axes(xlCategory).AxisTitle.Characters.Text = "mois"
.Axes(xlSeries).HasTitle = False
.Axes(xlValue).HasTitle = False
End With
ActiveChart.PlotArea.Select
ActiveChart.Legend.Select
Selection.Delete
ActiveChart.PlotArea.Select
ActiveChart.Axes(xlCategory).Select
Next x
End Sub