Sub Presse2()
Dim i&, f As Worksheet
Set f = Sheets("saisie planning")
Dim cht As Chart
Set cht = ActiveSheet.ChartObjects("GraphP2").Chart
cht.ChartArea.ClearContents
For i = 1 To 40
If f.Cells(2 + i, 3).Value <> 0 Then
cht.SeriesCollection.Add _
Source:=f.Range(f.Cells(2 + i, 2), f.Cells(2 + i, 3)), _
Rowcol:=xlRows, SeriesLabels:=True, CategoryLabels:=False, Replace:=False
With cht.SeriesCollection(cht.SeriesCollection.Count)
.HasDataLabels = True
.DataLabels.ShowSeriesName = True
.DataLabels.ShowValue = False
End With
End If
Next i
End Sub