Sub Calcul_Amplitude_Tableau()
Dim T As Variant, Tr As Variant, lg As Long, i As Long, Dt As Double, deb As Single, fin As Single
With ActiveSheet
lg = .Cells(Rows.Count, "A").End(xlUp).Row
T = .Range("A1:K" & lg).Value: ReDim Tr(1 To lg, 1 To 1)
For i = 4 To lg
If IsDate(T(i, 3)) Then
If Not Dt = CDate(T(i, 3)) Then
Dt = CDate(T(i, 3))
If deb <> 0 And fin <> 0 Then Tr(i - 1, 1) = fin - deb
deb = IIf(T(i, 4) = "", T(i, 6), T(i, 4))
Else
fin = IIf(T(i, 7) = "", T(i, 5), T(i, 7))
End If
End If
Next i
Tr(i - 1, 1) = fin - deb
.Range("H1").Resize(UBound(Tr, 1), UBound(Tr, 2)) = Tr
End With
End Sub