[COLOR="DarkSlateGray"][B]Sub toto()
Dim i&, j&, tmp, ComNL, ComPrevNL, CollPrevNL As New Collection
With Sheets("NL")
ComNL = .Range(.Cells(1, 4), .Cells(.Rows.Count, 3).End(xlUp)).Value
End With
ReDim Preserve ComNL(1 To UBound(ComNL, 1), 1 To 1)
With Sheets("PrevNL")
ComPrevNL = .Range(.Cells(1, 4), .Cells(.Rows.Count, 3).End(xlUp)).Value
ReDim Preserve ComPrevNL(1 To UBound(ComPrevNL, 1), 1 To 1)
For i = UBound(ComPrevNL, 1) To 2 Step -1
tmp = ComPrevNL(i, 1)
On Error Resume Next
CollPrevNL.Add tmp, CStr(tmp)
On Error GoTo 0
For j = 2 To UBound(ComNL, 1)
If ComNL(j, 1) = tmp Then Exit For
Next j
If j > UBound(ComNL, 1) Then
.Rows(i).EntireRow.Delete 'suppression d'un enregistrement obsolète
Else
Sheets("NL").Rows(j)[COLOR="Red"].Resize(1, 12)[/COLOR].Copy Destination:=.Rows(i).Cells(1, 1) 'actualisation d'un enregistrement existant
End If
Next i
j = .Cells(.Rows.Count, 3).End(xlUp).Row
For i = 2 To UBound(ComNL, 1)
tmp = ComNL(i, 1)
On Error GoTo E
CollPrevNL.Add tmp, CStr(tmp)
On Error GoTo 0
j = j + 1
Sheets("NL").Rows(i)[COLOR="Red"].Resize(1, 12)[/COLOR].Copy Destination:=.Rows(j).Cells(1, 1) 'ajout d'un enregistrement
R: Next i
End With
Exit Sub
E:
On Error GoTo 0
Resume R
End Sub[/B][/COLOR]