1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| LignesTableau = Application.CountA(Range("A1:A65536")) + 4
ActiveSheet.ListObjects.Add(xlSrcRange, Range(Cells(5, 1), Cells(LignesTableau, 4)), , xlNo).Name = _
"Liste1"
Sheets("Calcul").Select
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Calcul").Range(Cells(6, 4), Cells(LignesTableau, 4)), PlotBy _
:=xlColumns
' En fait quand je fais Range("D6:D125") ca marche nickel sauf qu'il n'y aura pas toujours de données jusque la case 125, il me faudrait un truc en fonction de LignesTableau
ActiveChart.SeriesCollection(1).XValues = "=Calcul!R6C1:R125C1"
ActiveChart.Location Where:=xlLocationAsNewSheet
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Analyse des Ecarts"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Sous Chapitres"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Heures"
End With |
Partager