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
| Sub Etiquettes()
'
' Etiquette Macro
' Macro enregistrée le 06/12/2002 par Bruno FACHE
'
Dim i As Byte
Dim NumGraph As Byte
' affiche les étiquettes des courbes bleu et rouge
Sheets("Graphiques").Select
For NumGraph = 1 To 3
If NumGraph = 3 Then NumGraph = 5
ActiveSheet.ChartObjects("Graphique " & NumGraph).Activate
For i = 2 To 3
On Error Resume Next
ActiveChart.SeriesCollection(i).DataLabels.Delete
On Error GoTo 0
ActiveChart.SeriesCollection(i).Points(ActiveChart.SeriesCollection(i).Points.Count).ApplyDataLabels _
Type:=xlDataLabelsShowValue, AutoText:=True, LegendKey:=False
' ActiveChart.SeriesCollection(i).DataLabels.Select
' ActiveChart.SeriesCollection(i).Points(ActiveChart.SeriesCollection(i).Points.Count).DataLabel.Select
With ActiveChart.SeriesCollection(i)
.HasDataLabels = True
.Points(.Points.Count).DataLabel.Select
End With
Selection.AutoScaleFont = False
With Selection.Font
.Name = "Arial"
.Size = 8
.Background = xlAutomatic
.Bold = True
If i = 2 Then
.ColorIndex = 5
Else
.ColorIndex = 3
End If
End With
Selection.NumberFormat = "#,##0 [$-1]"
Next i
Next NumGraph
End Sub |