Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range, P As Range, vide, n, a(), col
Set r = Intersect(Target, Range("E3:G" & Rows.Count), Me.UsedRange.EntireRow)
If r Is Nothing Then Exit Sub
For Each r In r 'si entrées multiples(copier-coller)
If CStr(r) <> "" And Not IsNumeric(r.Value2) Then Application.Undo: End
Set P = Intersect([E:G], r.EntireRow)
vide = Application.CountBlank(P) 'nombre de cellules vides
If vide = 0 Then
If P(2) <> P(1) + P(3) Then Application.Undo: End 'annulation
ElseIf vide = 1 Then
n = n + 1
ReDim Preserve a(1 To 2, 1 To n)
For col = 1 To 3
If P(col) = "" Then Exit For
Next col
a(1, n) = P(col).Address
Select Case col
Case 1: a(2, n) = P(2) - P(3)
Case 2: a(2, n) = P(1) + P(3)
Case 3: a(2, n) = P(2) - P(1)
End Select
End If
Next r
For col = 1 To n
Range(a(1, col)) = a(2, col)
Next col
End Sub