Function Graphe(Nbre_de_feuille As Integer)
On Error GoTo err_graph
Dim i As Integer
Dim Mn As Integer
Mn = 0
For i = 1 To Nbre_de_feuille
j = i - 1
Worksheets.Add
Mn = Mn + 5
Sheets(i - j).Select
Sheets(i - j).Activate
Sheets(i - j).Name = "Mns_" & Mn 'c'est à ce niveau qui renomme la feuille 2
AddChartObject
Next i
Exit Function
err_graph:
MsgBox Err.Description
End Function
Sub AddChartObject()
Dim j As Integer
Dim pat As Long
pat = memopat
If G_pat <= ligntot Then
With ActiveSheet
For j = 1 To 5
If j = 1 Then ActiveSheet.Shapes.AddChart(Left:=50, Width:=700, Top:=20, Height:=175).Select
If j = 2 Then ActiveSheet.Shapes.AddChart(Left:=50, Width:=700, Top:=225, Height:=175).Select
If j = 3 Then ActiveSheet.Shapes.AddChart(Left:=50, Width:=700, Top:=425, Height:=175).Select
If j = 4 Then ActiveSheet.Shapes.AddChart(Left:=50, Width:=700, Top:=625, Height:=175).Select
If j = 5 Then ActiveSheet.Shapes.AddChart(Left:=50, Width:=700, Top:=825, Height:=175).Select
With ActiveChart
.ChartType = xlColumnClustered
.SeriesCollection.NewSeries
.SeriesCollection(1).Name = "Min" & j
.SeriesCollection(1).Values = "=" & "DATA" & "!$B$" & pat + 5 & ":$B$" & pat + 12004 & ""
pat = pat + 12000
End With
Next j
End With
End If
memopat = pat
End Sub