1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Dim n as integer
n=3
Set Maplage1 = Sheets('Feuil1').Range(Cells(2 * n + 23, 2), Cells(2 * n + 27, 11))
Call ajout_graphe(Maplage1, "nom1", "Evolution")
Sub ajout_graphe(Maplage1 As Range, nomgraph As String, titre As String)
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Maplage1, PlotBy:=xlRows
ActiveChart.Location Where:=xlLocationAsObject, Name:=nomgraph
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = titre
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
End Sub |
Partager