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 47 48 49 50 51 52 53
| '=================================================================================================
'A la sélection d'un item de LST, toutes les séries sélectionnées sont tracées
'=================================================================================================
Private Sub LST_Change()
Dim DteDeb As Long, DteFin As Long
Dim i As Integer
Application.ScreenUpdating = False
SupprSer
DteDeb = 51000
DteFin = 0
With Feuil6.LST
For i = 0 To .ListCount - 1
If .Selected(i) Then Trace .List(i, 1), DteDeb, DteFin
Next i
End With
Application.ScreenUpdating = True
End Sub
'=================================================================================================
'Permet de tracer la courbe correspondant aux données de la colonne Col (colonne des dates)
'=================================================================================================
Private Sub Trace(ByVal Col As Integer, ByRef DD As Long, ByRef DF As Long)
Dim LastLig As Long
Dim PlayaX As Range
Dim Nom As String
Dim Ch As Chart
With Feuil11
LastLig = .Cells(.Rows.Count, Col).End(xlUp).Row
Nom = .Cells(Deb + 1, Col)
Set PlayaX = .Cells(Deb + 3, Col).Resize(LastLig - Deb - 2)
DD = Application.Min(DD, Application.Min(PlayaX))
DF = Application.Max(DF, Application.Max(PlayaX))
End With
Set Ch = Feuil6.ChartObjects(1).Chart
With Ch
.ChartType = xlXYScatterLinesNoMarkers
With .SeriesCollection.NewSeries
.name = Nom
.XValues = PlayaX
.Values = PlayaX.Offset(, -1)
End With
.Axes(xlCategory).MinimumScale = DD
.Axes(xlCategory).MaximumScale = DF
End With
Set PlayaX = Nothing
End Sub |
Partager