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 43
| Dim ligne As Integer
ligne = 5
While Sheets("Taux de service Mensuel 2").Range("B" & ligne).Value <> ""
Union(Range("C4:N4"), Range(Cells(ligne, 3), Cells(ligne, 14))).Select
Sheets(5).Shapes.AddChart.Select
activeChart.ChartType = xlColumnClustered
activeChart.SeriesCollection(1).Select
activeChart.SeriesCollection(1).ChartType = xlLine
activeChart.SeriesCollection(1).Name = "='Taux de service Mensuel 2'!$B$4"
activeChart.SeriesCollection(2).Name = "=""Taux de service"""
activeChart.SeriesCollection(2).XValues = _
"='Taux de service Mensuel 2'!$C$3:$N$3"
activeChart.SetElement (msoElementChartTitleAboveChart)
activeChart.ChartTitle.Text = Cells(ligne, 2)
Selection.Format.TextFrame2.TextRange.Characters.Text = Cells(ligne, 2)
With Selection.Format.TextFrame2.TextRange.Characters(1, 1).ParagraphFormat
.TextDirection = msoTextDirectionLeftToRight
.Alignment = msoAlignCenter
End With
With Selection.Format.TextFrame2.TextRange.Characters(1, 1).Font
.BaselineOffset = 0
.Bold = msoTrue
.NameComplexScript = "+mn-cs"
.NameFarEast = "+mn-ea"
.Fill.Visible = msoTrue
.Fill.ForeColor.RGB = RGB(0, 0, 0)
.Fill.Transparency = 0
.Fill.Solid
.Size = 18
.Italic = msoFalse
.Kerning = 12
.Name = "+mn-lt"
.UnderlineStyle = msoNoUnderline
.Strike = msoNoStrike
End With
ligne = ligne + 1
DoEvents
Wend
End Sub |
Partager