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
|
Public Sub SelectionAdheren()
Dim NumeroLigne As Integer
Dim MaPlage As Range
Range("A6:A2000").Select
Selection.Find(what:=Range("B1").Value, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate
NumeroLigne = ActiveCell.Row
ActiveCell.Select
ActiveWindow.Visible = False
Windows("Copie de +10 Centre.xls").Activate
Range(Cells(NumeroLigne, 5), Cells(NumeroLigne, 16)).Select
Plage = Range(Cells(NumeroLigne, 5), Cells(NumeroLigne, 16)).Address
plage1 = Range(Cells(NumeroLigne, 5), Cells(NumeroLigne, 5)).Address
plage2 = Range(Cells(NumeroLigne, 9), Cells(NumeroLigne, 9)).Address
plage3 = Range(Cells(NumeroLigne, 13), Cells(NumeroLigne, 13)).Address
Set MaPlage = Worksheets("consolidation!") + Plage
Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlBuiltIn, TypeName:= _
"Courbes - Histogramme"
ActiveChart.SetSourceData MaPlage, PlotBy:=xlRows
ActiveChart.SeriesCollection(1).Delete
ActiveChart.SeriesCollection.NewSeries
Windows("Copie de +10 Centre.xls").Activate
' ActiveSheet.Shapes("Graph10").DrawingObject.Chart.SeriesCollection(1).Values = "=consolidation!" & MaPlage
ActiveChart.SeriesCollection(1).Name = "=consolidation!R4C5"
ActiveChart.SeriesCollection(1).Values = _
"=(consolidation!plage1,consolidation!plage2,consolidation!plage3)"
ActiveChart.SeriesCollection(1).XValues = _
"=(consolidation!R3C5,consolidation!R3C9,consolidation!R3C13)"
With ActiveChart
.HasTitle = False
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
.Axes(xlCategory, xlSecondary).HasTitle = False
.Axes(xlValue, xlSecondary).HasTitle = False
End With |
Partager