Sub update()
Dim TabSuivi() As Variant
Dim TabExtract() As Variant
With Sheets("Suivi")
fin = .Range("A" & .Rows.Count).End(xlUp).Row 'dernière ligne non vide de la colonne A
TabSuivi = .Range("A2:J" & fin).Value 'on met dans un tablo
End With
With Sheets("extraction")
fin = .Range("A" & .Rows.Count).End(xlUp).Row
TabExtract = .Range("A2:J" & fin).Value
End With
For i = LBound(TabExtract, 1) To UBound(TabExtract, 1) 'pour chaque ligne du tablo
DéjàListé = False
For j = LBound(TabSuivi, 1) To UBound(TabSuivi, 1) 'on cherche si le code existe déjà
If TabSuivi(j, 2) = TabExtract(i, 2) Then
DéjàListé = True
'on met à jour la ligne
For col = LBound(TabSuivi, 2) To UBound(TabSuivi, 2)
TabSuivi(j, col) = TabExtract(i, col)
Next col
Exit For
End If
Next j
If Not (DéjàListé) Then
'il faut ajouter une ligne
With Sheets("Suivi")
fin = .Range("A" & .Rows.Count).End(xlUp).Row
For col = LBound(TabSuivi, 2) To UBound(TabSuivi, 2)
.Cells(fin + 1, col) = TabExtract(i, col)
Next col
End With
End If
Next i
With Sheets("Suivi")
.Range("A2").Resize(UBound(TabSuivi, 1), UBound(TabSuivi, 2)) = TabSuivi
End With
End Sub