Antworten:
Der Code des Kommentars wurde so bearbeitet, dass er blattübergreifend funktioniert. dies vergleichen sheet 1 Column A
zu sheet 2 column A
und entfernen Sie Duplikate aussheet 1
Sub removematches()
Dim firstcolumn() As Variant
Dim A As Range
Dim B As Range
Dim i As Long, del As Long
'This will set the ranges to look in.
Set A = Range("A:A")
Set B = Range("Sheet2!A:A")
firstcolumn = A
ReDim Preserve firstcolumn(1 To UBound(firstcolumn), 1 To 2) As Variant
i = 1
del = 0
Do While i <= UBound(firstcolumn)
firstcolumn(i, 2) = Application.WorksheetFunction.CountIf(B, firstcolumn(i, 1))
If firstcolumn(i, 2) > 0 Then
Range("A1").Offset(i - del - 1, 0).Delete Shift:=xlUp
del = del + 1
End If
i = i + 1
Loop
End Sub