Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng1 As Range, Rng2 As Range, lgns$
Set Rng1 = Intersect(Target, Me.[tb_Renvoi[AUTRES (RS)]])
Set Rng2 = Intersect(Target, Me.[tb_Renvoi[TERMINE]])
If Rng1 Is Nothing And Rng2 Is Nothing Then Exit Sub
Application.EnableEvents = False
If Not Rng1 Is Nothing Then
If Rng1.Address = Target.Address Then
For Each Zn In Rng1.Areas: For Each c In Zn
If c <> "" Then
valeurs = Intersect(c.EntireRow, Me.[tb_Renvoi]).Resize(, sh_Suivi.[tb_Suivi].Columns.Count - 1)
lgns = c.Row & ";" & lgns
With sh_Suivi.[tb_Suivi]
If .Rows.Count = 1 And .Cells(1) = "" Then
.Resize(1, UBound(valeurs, 2)).Value = valeurs
Else
.Offset(.Rows.Count).Resize(1, UBound(valeurs, 2)).Value = valeurs
End If
End With
End If
Next c: Next Zn
End If
ElseIf Not Rng2 Is Nothing Then
If Rng2.Address = Target.Address Then
For Each Zn In Rng2.Areas: For Each c In Zn
If UCase(c) = "FIN" Then
valeurs = Intersect(c.EntireRow, Me.[tb_Renvoi])
lgns = c.Row & ";" & lgns
With sh_Terminé.[tb_Terminé]
If .Rows.Count = 1 And .Cells(1) = "" Then
.Resize(1, UBound(valeurs, 2)).Value = valeurs
Else
.Offset(.Rows.Count).Resize(1, UBound(valeurs, 2)).Value = valeurs
End If
End With
End If
Next c: Next Zn
End If
End If
If lgns <> "" Then
LignesàDétruire = Split(lgns, ";")
For i = 0 To UBound(LignesàDétruire) - 1
Me.Rows(LignesàDétruire(i)).Delete
Next i
End If
Application.EnableEvents = True
End Sub