darkspoilt | voila ma ligne d'entrée Code :
- module2.Macro1(wbfile,appli)
|
et mon code complet
Code :
- 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
|
Message édité par darkspoilt le 18-06-2007 à 14:00:08
|