Ich meine, dies irgendwo mal gesehen zu haben.
Ein Code der bewirkt, dass wenn ich z.B. Zelle A4 eines Tabellenblattes anwähle, alle anderen Zellen mit dem gleichen Inhalt gelb markiert werden.
Nur wo finden?
Gruss, Peter
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Worksheets("Tabelle1").Range("a1:h500")
.Interior.ColorIndex = xlNone
If Target.Value = "" Then Exit Sub
Set c = .Find(Target.Value, lookat:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Interior.ColorIndex = 6
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Zelle As Range
Range("A1:H500").Interior.ColorIndex = xlNone
If Target.Address(0, 0) = "A4" Then
For Each Zelle In Range("A1:H500").Cells
If Zelle.Value = Target.Value Then Zelle.Interior.ColorIndex = 6
Next Zelle
End If
End Sub