Sub Macro1()
Sheets("Feuil3").Select
Application.ScreenUpdating = False 'bloque le rafraichissement de l'affichage des pages
Application.DisplayFullScreen = True 'passe en mode plein écran
'Application.WindowState = xlNormal
'ActiveSheet.Shapes.AddShape(msoShapeRectangle, 50, 50, 30, 30).Name = "Rec1"
'ActiveSheet.Shapes.AddShape(msoShapeRectangle, 50, 50, 30, 30).Name = "Rec2"
'ActiveSheet.Shapes("Rect1").Visible = False 'montre ou cache les rectangles, mais ils sont toujours là
ActiveSheet.Shapes("Rect1").Visible = True
'ActiveSheet.Shapes("Rect2").Visible = False
ActiveSheet.Shapes("Rect2").Visible = True
'Tout ça est à arranger et à mettre en forme
ActiveSheet.ChartObjects("Graphique 1").Activate ' selection du graphe et mise en forme, dim et bornes grille
MinScale = 0
MaxScale = 35
HScale = MaxScale - MinScale
MajUnit = 5
MinUnit = 1
coef0 = 1 ' coefficients pour mise à l'echelle des données si necéssaire
coef1 = 10
coef2 = 60
ActiveSheet.ChartObjects("Graphique 1").Top = 14.25 ' dim du graphe
ActiveSheet.ChartObjects("Graphique 1").Left = 98.25
ActiveSheet.ChartObjects("Graphique 1").Height = 499.5
ActiveSheet.ChartObjects("Graphique 1").Width = 909
ActiveChart.PlotArea.Select 'ZONE GRAPHE
ActiveChart.PlotArea.Top = 6.6
ActiveChart.PlotArea.Left = 1
ActiveChart.PlotArea.Height = 488
ActiveChart.PlotArea.Width = 893
a = ActiveSheet.Shapes("Rect1").Top 'recupératuions des coordonnées de la grille pour positionner les hemis
b = ActiveSheet.Shapes("Rect1").Left
c = ActiveSheet.Shapes("Rect2").Top
d = ActiveSheet.Shapes("Rect2").Left
'tout ça est à simplifier, ça reste un brouillon
ActiveSheet.ChartObjects("Graphique 1").Activate
ActiveChart.Axes(xlValue).MinimumScale = MinScale ' minimum maxim des y
ActiveChart.Axes(xlValue).MaximumScale = MaxScale
ActiveChart.Axes(xlValue).MajorUnit = MajUnit ' les x
ActiveChart.Axes(xlValue).MinorUnit = MinUnit
ActiveChart.Axes(xlCategory).TickMarkSpacing = 1 'espacement des gradua
'ActiveChart.Axes(xlCategory).TickLabelSpacing = 1
ActiveChart.Axes(xlCategory).TickLabelSpacingIsAuto = True
Sheets("Feuil4").Select
Select Case Sheets("Feuil4").Cells(3, 4) ' selection des 1/2 hemis sup suivant val tableau
Case Is = 1
img = "IMAS1"
Case Is = 2
img = "IMAS2"
Case Is = 3
img = "IMAS3"
Case Is = 4
img = "IMAS4"
End Select
ActiveSheet.Shapes(img).Copy ' copie sur graphe
Sheets("Feuil3").Select
ActiveSheet.Paste
ActiveSheet.Shapes(img).Select
Selection.Name = "IMASX"
'calcul des coordonnées d'affichage et des dim des hemis
Selection.Height = (Sheets("Feuil4").Cells(3, 3) * coef0)
Selection.Top = c - (Sheets("Feuil4").Cells(3, 2) * coef1) - Selection.Height
Selection.Left = b + Sheets("Feuil4").Cells(3, 1) * coef2 - Selection.Height
Sheets("Feuil4").Select ' rebelotte pour les hemis inf
Select Case Sheets("Feuil4").Cells(3, 6)
Case Is = 1
img = "IMAB1"
Case Is = 2
img = "IMAB2"
Case Is = 3
img = "IMAB3"
Case Is = 4
img = "IMAB4"
End Select
ActiveSheet.Shapes(img).Copy
Sheets("Feuil3").Select
ActiveSheet.Paste
ActiveSheet.Shapes(img).Select
Selection.Name = "IMASY"
Selection.Height = (Sheets("Feuil4").Cells(3, 5) * coef0)
Selection.Top = c - (Sheets("Feuil4").Cells(3, 2) * coef1)
Selection.Left = b + Sheets("Feuil4").Cells(3, 1) * coef2 - Selection.Height
Cells(1, 1).Select
Application.ScreenUpdating = True 'rafraichissement ecran
End Sub