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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
| Option Compare Database
Option Explicit
Public Sub Macro1(wbfile As Workbook, xls As Excel.Application)
'
' Macro1 Macro
' Macro enregistrée le 14/06/2007 par
'
'
Dim graph As Chart
Set graph = wbfile.Charts.Add
graph.SeriesCollection(1).ChartType = xlColumnStacked
graph.SeriesCollection.NewSeries
graph.SeriesCollection(1).XValues = "=R_analyse_croisée!R3C2:R4C10"
graph.SeriesCollection(1).name = "=R_analyse_croisée!R53C1"
graph.SeriesCollection(2).XValues = "=R_analyse_croisée!R3C2:R4C10"
graph.SeriesCollection(2).name = "=R_analyse_croisée!R54C1"
graph.SeriesCollection(3).XValues = "=R_analyse_croisée!R3C2:R4C10"
graph.SeriesCollection(3).Values = "=R_analyse_croisée!R48C2:R48C10"
graph.SeriesCollection(3).Select
graph.SeriesCollection(3).ChartType = xlXYScatter
With graph.SeriesCollection(3).Border
.Weight = xlHairline
.LineStyle = xlNone
End With
With graph.SeriesCollection(3)
.MarkerBackgroundColorIndex = xlAutomatic
.MarkerForegroundColorIndex = xlAutomatic
.MarkerStyle = xlNone
.Smooth = False
.MarkerSize = 5
.Shadow = False
End With
graph.SeriesCollection(3).ApplyDataLabels AutoText:=True, LegendKey:=False, ShowSeriesName:=False, ShowCategoryName:=False, ShowValue:=True, ShowPercentage:=False, ShowBubbleSize:=False
graph.SeriesCollection(3).DataLabels.Select
graph.SeriesCollection(3).Points(1).DataLabel.Left = 50
graph.SeriesCollection(3).Points(1).DataLabel.Top = 158
graph.SeriesCollection(3).Points(2).DataLabel.Left = 114
graph.SeriesCollection(3).Points(2).DataLabel.Top = 76
graph.SeriesCollection(3).Points(3).DataLabel.Left = 178
graph.SeriesCollection(3).Points(3).DataLabel.Top = 64
graph.SeriesCollection(3).Points(4).DataLabel.Left = 243
graph.SeriesCollection(3).Points(4).DataLabel.Top = 23
graph.SeriesCollection(3).Points(5).DataLabel.Left = 306
graph.SeriesCollection(3).Points(5).DataLabel.Top = 45
graph.SeriesCollection(3).Points(6).DataLabel.Left = 371
graph.SeriesCollection(3).Points(6).DataLabel.Top = 148
graph.SeriesCollection(3).Points(7).DataLabel.Left = 436
graph.SeriesCollection(3).Points(7).DataLabel.Top = 123
graph.SeriesCollection(3).Points(8).DataLabel.Left = 504
graph.SeriesCollection(3).Points(8).DataLabel.Top = 328
graph.SeriesCollection(3).Points(9).DataLabel.Left = 569
graph.SeriesCollection(3).Points(9).DataLabel.Top = 312
With graph.SeriesCollection(2).Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
graph.SeriesCollection(2).Shadow = False
graph.SeriesCollection(2).InvertIfNegative = False
With graph.SeriesCollection(2).Interior
.ColorIndex = 37
.Pattern = xlSolid
End With
graph.SeriesCollection(2).ApplyDataLabels AutoText:=True, LegendKey:=False, ShowSeriesName:=False, ShowCategoryName:=False, ShowValue:=True, ShowPercentage:=False, ShowBubbleSize:=False
With graph.SeriesCollection(1).Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
graph.SeriesCollection(1).Shadow = False
graph.SeriesCollection(1).InvertIfNegative = False
With graph.SeriesCollection(1).Interior
.ColorIndex = 10
.Pattern = xlSolid
End With
graph.SeriesCollection(1).ApplyDataLabels AutoText:=True, LegendKey:=False, ShowSeriesName:=False, ShowCategoryName:=False, ShowValue:=True, ShowPercentage:=False, ShowBubbleSize:=False
With graph.PlotArea.Border
.ColorIndex = 16
.Weight = xlThin
.LineStyle = xlContinuous
End With
With graph.PlotArea.Interior
.ColorIndex = 2
.PatternColorIndex = 1
.Pattern = xlSolid
End With
With graph.SeriesCollection(3).DataLabels.Border
.Weight = xlHairline
.LineStyle = xlNone
End With
graph.SeriesCollection(3).DataLabels.Shadow = False
graph.SeriesCollection(3).DataLabels.Interior.ColorIndex = xlNone
graph.SeriesCollection(3).Points(2).DataLabel.Select
graph.SeriesCollection(3).Points(1).DataLabel.Select
graph.SeriesCollection(3).DataLabels.AutoScaleFont = True
With graph.SeriesCollection(3).DataLabels.Font
.name = "Arial"
.FontStyle = "Gras"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 3
.Background = xlAutomatic
End With
graph.SeriesCollection(2).DataLabels.AutoScaleFont = True
With graph.SeriesCollection(2).DataLabels.Font
.name = "Arial"
.FontStyle = "Gras"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
graph.SeriesCollection(1).DataLabels.AutoScaleFont = True
With graph.SeriesCollection(1).DataLabels.Font
.name = "Arial"
.FontStyle = "Gras"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
graph.Legend.LegendEntries(3).Delete
graph.Legend.Left = 35
graph.Legend.Top = 25
graph.Legend.Width = 99
graph.Legend.Width = 107
End Sub |
Partager