DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, [C10:J40]) Is Nothing Then Exit Sub
[C10:J40].Interior.Color = xlNone
If Target = "" Then Exit Sub
For Each hucre In [C10:J40]
If hucre <> "" And hucre.Value = Target Then
hucre.Interior.Color = vbRed
End If
Next
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set Rng = Range(Range("C10"), Range("J40"))
With Rng
Rng.Interior.Pattern = xlNone
Set c = .Find(Target, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Interior.Color = 255
Set c = .FindNext(c)
If c Is Nothing Then
GoTo DoneFinding
End If
Loop While c.Address <> firstAddress
End If
DoneFinding:
End With
End Sub
Hiç görmediğim farklı bir yöntem olmuş.Alternatif olarak , benim kod da hücre seçince çalışır
Kod:Private Sub Worksheet_SelectionChange(ByVal Target As Range) Set Rng = Range(Range("C10"), Range("J40")) With Rng Rng.Interior.Pattern = xlNone Set c = .Find(Target, LookIn:=xlValues) If Not c Is Nothing Then firstAddress = c.Address Do c.Interior.Color = 255 Set c = .FindNext(c) If c Is Nothing Then GoTo DoneFinding End If Loop While c.Address <> firstAddress End If DoneFinding: End With End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("C10:J40")) Is Nothing Then Exit Sub
Set Rng = Range(Range("C10"), Range("J40"))
With Rng
Rng.Interior.Pattern = xlNone
If Target <> "" Then
Set c = .Find(Target, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Interior.Color = 255
Set c = .FindNext(c)
If c Is Nothing Then
GoTo DoneFinding
End If
Loop While c.Address <> firstAddress
End If
End If
DoneFinding:
End With
End Sub