Sub ReconstruireFormules()
Dim ColA As Range, i&, n&, zoneA&(), celBaseF1 As Range, plageF1 As Range, plageF2 As Range, plageF3 As Range, deb&, fin&
Set ColA = Range("A3", Range("A" & Rows.Count).End(xlUp))
If ColA.Row < 3 Then Exit Sub 'si tableau vide
'Application.ScreenUpdating = False
'ColA.EntireRow.Sort ColA, xlAscending, Header:=xlNo 'tri de sécurité
'''*addendum/////////////////////////////////////////////////////////////
Application.ScreenUpdating = False
ColA.EntireRow.Sort ColA, xlAscending, Header:=xlNo 'tri de sécurité
On Error Resume Next 'si aucune SpecialCell
ColA.SpecialCells(xlCellTypeBlanks).EntireRow.Delete 'vides
ColA.SpecialCells(xlCellTypeConstants, 2).EntireRow.Delete 'textes
On Error GoTo 0
'''* fin addendum////////////////////////////////////////////////////////
'---lignes de début et de fin de zones en colonne A---
For i = 1 To ColA.Count
If ColA(i) <> ColA(i - 1) Then
n = n + 1
ReDim Preserve zoneA(1 To 2, 1 To n)
zoneA(1, n) = i
End If
zoneA(2, n) = i
Next
'---initialisation des cellules de base et des plages des formules---
Set celBaseF1 = [H3,J3,L3,N3,P3]
Set plageF1 = Intersect(ColA.EntireRow, [T:T]).Offset(, -5)
Set plageF2 = Intersect(ColA.EntireRow, [U:U]).Offset(, -5)
Set plageF3 = Intersect(ColA.EntireRow, [V:V]).Offset(, -5)
'---formules F1 F2 F3---
For i = 1 To 5
Set plageF1 = plageF1.Offset(, 5)
Set plageF2 = plageF2.Offset(, 5): plageF2 = ""
Set plageF3 = plageF3.Offset(, 5)
plageF1 = "=" & celBaseF1.Areas(i).Address(0, 0) & "*" & plageF1(1, -1).Address(0, 0) & "+2*" & plageF1(1, 0).Address(0, 0)
For n = 1 To UBound(zoneA, 2)
deb = zoneA(1, n): fin = zoneA(2, n)
plageF2(deb) = "=MIN(" & plageF1(deb).Address(0, 0) & ":" & plageF1(fin).Address(0, 0) & ")"
plageF3(deb).Resize(fin - deb + 1) = "=13*" & plageF2(deb).Address(1, 0) & "/" & plageF1(deb).Address(0, 0)
Next n, i
'---dernières formules---
Intersect(ColA.EntireRow, [AQ:AQ]) = "=AVERAGE(V3,AA3,AF3,AK3,AP3)"
Intersect(ColA.EntireRow, [AV:AV]) = "=SUM(AQ3:AU3)"
End Sub