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 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
Worksheets("Graph").Activate
'calcul du nouveau nombre de colonnes
nb_colonnes = range("A1").End(xlToRight).Column
nb_colonnes = 5
'calcul du nouveau nombre de lignes
nb_lignes = range("A1").End(xlDown).Row
Dim tmp As range
Set tmp = range(Cells(1, 1), Cells(nb_lignes, nb_colonnes))
x = tmp.AddressLocal
x = Replace(x, "$", "")
range(x).Select
Charts.Add
ActiveChart.ChartType = xlLine
ActiveChart.SeriesCollection(1).Name = "=""ISIN1"""
ActiveChart.SeriesCollection(2).Name = "=""ISIN2"""
ActiveChart.SeriesCollection(3).Name = "=""ISIN3"""
ActiveChart.SeriesCollection(4).Name = "=""ISIN4"""
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = Titre
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
End With
ActiveChart.HasLegend = True
ActiveChart.Legend.Select
Selection.Position = xlBottom
ActiveChart.HasDataTable = False
Chart = Right(ActiveChart.Name, 9)
ActiveSheet.Shapes(Chart).IncrementTop -40.25
ActiveSheet.Shapes(Chart).IncrementLeft -210.25 |
Partager