Private Sub Btn_Ok_Click()
Dim Boucle As Integer, s2 As ChSeries, c As Object
With ChartSpace1
If .Charts.Count > 0 Then .Clear
.Charts.Add
.Charts(0).Type = chChartTypeColumnClustered
.Charts(0).HasTitle = True
.Charts(0).HasLegend = True
.Charts(0).Title.Caption = "Test Chart"
.Charts(0).Legend.Position = chLegendPositionTop
.Charts(0).Axes(1).HasTitle = True
.Charts(0).Axes(1).Title.Caption = "Time"
.Charts(0).Axes(1).MajorTickMarks = chTickMarkAutomatic
.Charts(0).Axes(0).HasTitle = True
.Charts(0).Axes(0).Title.Caption = "Contrôle poids " & Cbx_Element.Value & " P23 Atelier " & Cbx_Atelier.Value
End With
With Sheets("Resultats")
For Boucle = 2 To .Cells(65535, 1).End(xlUp).Row Step 1
If .Cells(Boucle, 3).Value = [COLOR="Red"][B]Val[/B][/COLOR](Cbx_Poste.Value) And .Cells(Boucle, 4).Value =[COLOR="red"][B] Val[/B][/COLOR](Cbx_Atelier.Value) And .Cells(Boucle, 5).Value = Cbx_Appareil.Value And .Cells(Boucle, 6).Value = Cbx_Element.Value Then
[COLOR="red"][B]Set s2 = ChartSpace1.Charts(0).SeriesCollection.Add
Set c = ChartSpace1.Constants
s2.SetData c.chDimValues, c.chDataLiteral, .Cells(Boucle, 7).Value[/B][/COLOR]
End If
Next Boucle
End With
End Sub