1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
Sub commentaire()
ActiveSheet.ChartObjects(1).Activate
On Error Resume Next
ActiveChart.SeriesCollection(1).ApplyDataLabels Type:=xlDataLabelsShowLabel
On Error GoTo 0
For i = 1 To ActiveChart.SeriesCollection(1).Points.Count
ActiveChart.SeriesCollection(1).Points(i).DataLabel.Select
Selection.Interior.Color = ActiveSheet.Cells(i + 1, 1).Interior.Color
Selection.Font.Size = 7
Selection.Text = ActiveSheet.Cells(i + 1, 1)
ActiveChart.SeriesCollection(1).Points(i).MarkerBackgroundColorIndex = 4
ActiveChart.SeriesCollection(1).Points(i).MarkerBackgroundColor = ActiveSheet.Cells(i + 1, 1).Interior.Color
Next i
End Sub |
Partager