Bonjour,
après essai, la macro fonction seulement si elle ne contient qu'un seul ordre :
Dim sh As Worksheet
Set sh = Worksheets("ESSAI")
sh.ChartObjects("Graphique 1").Activate
ActiveChart.FullSeriesCollection(2).Points(4).Select
With Selection.Format.Line
.Visible = msoTrue
If sh.Range("d8") <= sh.Range("b8") Then
.ForeColor.RGB = RGB(0, 255, 0)
Else
.ForeColor.RGB = RGB(255, 0, 0)
End if
.Transparency = 0
End With
With Selection.Format.Line
.Visible = msoTrue
.Weight = 7
End With
A partir du moment ou j'en met plus d'un tout est détraqué et les je ne comprend pas pourquoi.. :
Dim sh As Worksheet
Set sh = Worksheets("ESSAI")
sh.ChartObjects("Graphique 1").Activate
ActiveChart.FullSeriesCollection(2).Points(4).Select
With Selection.Format.Line
.Visible = msoTrue
If sh.Range("d8") <= sh.Range("b8") Then
.ForeColor.RGB = RGB(0, 255, 0)
Else
.ForeColor.RGB = RGB(255, 0, 0)
End if
.Transparency = 0
End With
With Selection.Format.Line
.Visible = msoTrue
.Weight = 7
End With
sh.ChartObjects("Graphique 1").Activate
ActiveChart.FullSeriesCollection(2).Points(3).Select
With Selection.Format.Line
.Visible = msoTrue
If sh.Range("d9") <= sh.Range("b9") Then
.ForeColor.RGB = RGB(0, 255, 0)
Else
.ForeColor.RGB = RGB(255, 0, 0)
End if
.Transparency = 0
End With
With Selection.Format.Line
.Visible = msoTrue
.Weight = 7
End With