ich habe eine Spalte mit Zahlenkolonnen und möchte hier die doppelten markieren (entweder farblich oder rechts daneben in der freien Zelle mittels einer 1).
Wer weiß Rat.
mit Dank + mfg
Walter
Public Sub DoppelteMarkieren()
Dim lZeile As Long
Dim sDuplikate As String
With ThisWorkbook.Worksheets("Tabelle1")
Columns(1).Interior.ColorIndex = xlNone
For lZeile = 1 To .Cells(Rows.Count, 1).End(xlUp).Row
If Application.WorksheetFunction.CountIf(Columns(1), Range("A" & lZeile).Value) > 1 _
Then
If sDuplikate = "" Then
sDuplikate = "A" & lZeile
Else
sDuplikate = sDuplikate & ",A" & lZeile
End If
End If
Next lZeile
If sDuplikate "" Then .Range(sDuplikate).Interior.ColorIndex = 3
End With
End Sub
Gruß Peter
A | |
1 | 15 |
2 | 12 |
3 | 15 |
4 | 18 |
5 | 19 |
6 | 15 |
Bedingte Formatierungen der Tabelle | |||||||||||||||||||||
|