AW: Doppelte Eintraege loeschen
06.08.2008 21:10:00
mpb
Hallo,
Sub Duplikate_weg2()
'Löscht die ganze Zeile
Dim Rg As Range
Application.ScreenUpdating = False
z = Cells(65536, 1).End(xlUp).Row
For j = z To 1 Step -1
Set Rg = Range(Cells(1, 1), Cells(z, 1))
If Application.WorksheetFunction.CountIf(Rg, "=" & Cells(j, 1)) > 1 Then
Rows(j).Delete Shift:=xlUp
End If
Next j
Application.ScreenUpdating = True
End Sub
Sub Duplikate_weg3()
'Löscht die Zellen in den Spalten A und B
Dim Rg As Range
Application.ScreenUpdating = False
z = Cells(65536, 1).End(xlUp).Row
For j = z To 1 Step -1
Set Rg = Range(Cells(1, 1), Cells(z, 1))
If Application.WorksheetFunction.CountIf(Rg, "=" & Cells(j, 1)) > 1 Then
Range(Cells(j,1), Cells(j,2).Delete Shift:=xlUp
End If
Next j
Application.ScreenUpdating = True
End Sub
beides ungetestet.
Gruß
Martin