1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
Sub mise_forme_graphe()
Application.ScreenUpdating = False
Dim gr As Chart
Dim num As Integer
Dim i As Long
i = 9
' récupère la dernière valeur entrée et donc le nombre de points pour le graphe
While Sheets("ACCUEIL").Cells(i, 6).Value <> ""
i = i + 1
Wend
i = i - 1
Set gr = ThisWorkbook.Charts(1)
'sélection des données ??
With gr
For num = 1 To 2
.SeriesCollection(num).XValues = ThisWorkbook.Sheets("ACCUEIL").Range("C9:C" & i).Value
.SeriesCollection(num).Values = ThisWorkbook.Sheets("CALCUL").Range(Cells(9, num + 7), Cells(i, num + 7)).Value
Next
.SeriesCollection(3).XValues = ThisWorkbook.Sheets("ACCUEIL").Range("C9:C" & i).Value
.SeriesCollection(3).Values = ThisWorkbook.Sheets("CALCUL").Range(Cells(9, 11), Cells(i, 11)).Value
End With
Application.ScreenUpdating = True
Set gr = Nothing
End Sub |
Partager