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 58 59 60 61 62 63 64 65 66 67 68 69
|
Sub Macro1()
'Macro1
'Macro recorded 16/08/2010 by fd151
'
'Keyboard ShortCut: Ctrl + a
Dim MyChart As Chart
Set MyChart = Charts.Add
With MyChart
.ChartType = xlLine
.SetSourceDate Source:=Sheets("Sheet3").Range("E15")
.SeriesCollection.NewSeries
.SeriesCollection(1).XValue = "=Sheet2!R2C14:R2C30"
.SeriesCollection(1).Value = "=Sheet2!R43C14:R43C30"
.SeriesCollection(1).Name = "=""FTE/MOIS"""
.Location Where:=xlLocationAsObject, Name:="Sheet3"
.HasTitle = True
.ChartTitle.Characters.text = _
"Charge en FTE"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "MOIS"
.Axes(xlValue).MinimumScale = 0
.Axes(XlValue).MaximumScale = 10
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "FTE"
.HasDataTable = False
.Shapes("Chart 3").IncrementLeft -9,75
.Shapes("Chart 3").IncrementTop 1,5
.PlotArea.Select
With Selection.Border
.ColorIndex = 2
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection.Interior
.ColorIndex = 15
.PatternColorIndex = 1
.Pattern = xlSolid
end with
MyChart.Axes(xlValue).MajorGridlines.select
MyChart.PlotArea.select
With Selection.Border
.ColorIndex = 2
.Weight = XlThin
.LineStyle = xlContinuous
End with
With Selection.Interior
.ColorIndex = 2
.PatternColorIndex = 1
.Pattern = XlSolid
End With
MyChart.SeriesCollection(1).select
With Selection.border
.colorIndex = 3
.Weight = XlThick
.LineStyle = xlContinuous
End With
With selection
.MarkerBackgroundColorIndex = xlNone
.MarkerForegroundColorIndex = xlNone
.MarkerStyle = xlNone
.Smooth = False
.MarkerSize = 3
.Shadow = False
End with
My Chart.Axes(xlValue).select
End sub |
Partager