Re : Exécuter une macro sur plusieurs feuilles
Bonjour,
J'ai enregistré mon code dans ThisWorkbook d'accord mais est-ce que tu peux développer la suite ? Je ne comprends pas bien a quel endroit je dois mettre cette variable "Sh" ...
Voici mon code :
"Sub graphique()
'
' graphique Macro
'
'
Range("A1:I8").Select
Selection.Copy
Range("A10").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("D12").Select
ActiveCell.FormulaR1C1 = "=R[-9]C-SUM(R[-9]C[-2]:R[-9]C[-1])"
Range("D12").Select
Selection.AutoFill Destination:=Range("D12
17"), Type:=xlFillDefault
Range("D12
17").Select
Range("F12").Select
ActiveCell.FormulaR1C1 = "=R[-9]C-SUM(R[-9]C[-2]:R[-9]C[-1])"
Range("F12").Select
Selection.AutoFill Destination:=Range("F12:F17"), Type:=xlFillDefault
Range("F12:F17").Select
Range("H12").Select
ActiveCell.FormulaR1C1 = "=R[-9]C-SUM(R[-9]C[-2]:R[-9]C[-1])"
Range("H12").Select
Selection.AutoFill Destination:=Range("H12:H17"), Type:=xlFillDefault
Range("H12:H17").Select
Range("A10:I17").Select
ActiveSheet.Shapes.AddChart2(297, xlBarStacked).Select
ActiveChart.SetSourceData Source:=Range("'25-08-2015'!$A$10:$I$17")
ActiveChart.Parent.Delete
Range("A10:G17").Select
ActiveSheet.Shapes.AddChart2(297, xlBarStacked).Select
ActiveChart.SetSourceData Source:=Range("'25-08-2015'!$A$10:$G$17")
ActiveChart.PlotBy = xlColumns
ActiveChart.Axes(xlCategory).Select
ActiveChart.Axes(xlCategory).ReversePlotOrder = True
ActiveChart.SetElement (msoElementChartTitleNone)
ActiveChart.Axes(xlValue).Select
ActiveChart.Axes(xlValue).MinimumScale = 0.333333
ActiveChart.Axes(xlValue).MaximumScale = 0.708333
ActiveChart.Axes(xlValue).MajorUnit = 0.020833
ActiveChart.FullSeriesCollection(1).Select
Selection.Format.Fill.Visible = msoFalse
ActiveChart.FullSeriesCollection(3).Select
Selection.Format.Fill.Visible = msoFalse
ActiveChart.FullSeriesCollection(5).Select
Selection.Format.Fill.Visible = msoFalse
ActiveChart.ChartArea.Select
ActiveSheet.Shapes("Graphique 2").ScaleWidth 1.5770833333, msoFalse, _
msoScaleFromTopLeft
End Sub"