1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Sub creationGraphiqueParTableau()
Dim Tableau() As Variant, Tableau2() As Variant, Tableau3() As Variant
With ThisWorkbook.Worksheets("Export")
x = Application.CountIf(.Range("AA1:AA20"), "CSI")
x1 = Application.CountIf(.Range("AA1:AA20"), "GCS")
Tableau() = Array("janv-15", "févr-15")
Tableau2() = Array(x, x1)
Tableau3() = Array("GCS", "CSI")
End With
Charts.Add
ActiveChart.Location _
Where:=xlLocationAsObject, Name:="Test"
With ActiveChart
.ChartType = xlColumnStacked
For i = 1 To 2
.SeriesCollection.NewSeries
.SeriesCollection(i).Values = Tableau2(i)
.SeriesCollection(i).Name = Tableau3(i)
Next i
.SeriesCollection(1).XValues = Tableau
End With
End Sub |
Partager