Probleme mit Application.CountIf
04.04.2013 14:16:08
Wolle
Möchte bei meiner Dublettensuche nicht nur die doppelten Datensätze markieren sondern alle.
Bisher ist es so.
wolle
mark
wolle Ich hätte es aber gerne so:
wolle mark
wolle Mein Code sieht so aus und ist zum großen Teil aus dem Forum übernommen:
Sub DublettenFilter()
Application.ScreenUpdating = False
Application.EnableEvents = False
'Variablen deklarieren
Dim RaZelle As Range
Dim IntRow As Long
Dim Start As Long
'ermitteln wieviel Reihen die Tabelle hat
IntRow = IIf(IsEmpty(Cells(Rows.Count, 1)), _
Cells(Rows.Count, 1).End(xlUp).Row, Rows.Count)
For Start = IntRow To 1 Step -1
If Not IsEmpty(Cells(Start, 1)) Then
If Application.CountIf(Range("A1:A" & Start), Cells(Start, 1)) > 1 Then
If RaZelle Is Nothing Then
Set RaZelle = Cells(Start, 1)
Else
Set RaZelle = Union(RaZelle, Cells(Start, 1))
End If
End If
End If
Next
If Not RaZelle Is Nothing Then
RaZelle.EntireRow.Interior.Color = 255
End If
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Was kann ich machen damit es funktioniert?Ist Application.CountIf dann falsch?
Gruß, Wolle