Private Sub Worksheet_Calculate()
'adaptez les cellules M4 J4 J5 M17 J17 J18
Dim h#, h1#
Application.EnableEvents = False
Me.Shapes("Spinner 4").ControlFormat.Max = [M4]
h = [M4].MergeArea.Height
h1 = h * [J4] / IIf([M4], [M4], 1)
Me.Shapes("ZoneTexte 1").Top = [M4].Top
Me.Shapes("ZoneTexte 1").Height = IIf(h1 < 10, 10, IIf(h1 > h - 10, h - 10, h1))
Me.Shapes("ZoneTexte 2").Top = [M4].Top + Me.Shapes("ZoneTexte 1").Height
Me.Shapes("ZoneTexte 2").Height = h - Me.Shapes("ZoneTexte 1").Height
Me.Shapes("Compteur 1").ControlFormat.Max = [J5] + [M17]
h = [M17].MergeArea.Height
h1 = h * [J17] / IIf([J5] + [M17], [J5] + [M17], 1)
Me.Shapes("ZoneTexte 3").Top = [M17].Top
Me.Shapes("ZoneTexte 3").Height = IIf(h1 < 10, 10, IIf(h1 > h - 10, h - 10, h1))
Me.Shapes("ZoneTexte 4").Top = [M17].Top + Me.Shapes("ZoneTexte 3").Height
Me.Shapes("ZoneTexte 4").Height = h - Me.Shapes("ZoneTexte 3").Height
Application.EnableEvents = True
End Sub