- Katılım
- 5 Kasım 2007
- Mesajlar
- 4,727
- Excel Vers. ve Dili
- 64 Bit TR - Microsoft Office 365 - Win11 Home
Merhaba,
Aşağıdaki kod ile aranan değeri bulup renklendiriliyor, ancak kod bu haliyle belirli bir aralığı buluyor,
İstediğim; F3:K yada F3:K300 aralığında istenen veriyi bulup renklendirmesi,
Ancak bir nüans var, aranılan sayı 5 ise sadece 5'leri bulmalı, 15, 25, 52 gibi sayıları renklendirmemeli,
Teşekkür ederim.
Sub BUL()
yer = WorksheetFunction.CountA(Columns("F"))
Range("F3:K" & yer).Interior.ColorIndex = 2
ad = InputBox("aranacak değeri yazınız.", "DEĞER", "")
If ad = "" Then
MsgBox "İşlemi iptal ettiniz"
Exit Sub
End If
sat = 0
With Range("F3:K" & WorksheetFunction.CountA(Rows(1)) + 2)
Set d = .Find(ad, LookIn:=xlValues)
If Not d Is Nothing Then
firstAddress = d.Address
Do
d.Interior.ColorIndex = 3 'buradaki sayı renkleri göstermektedir.
sat = sat + 1
Set d = .FindNext(d)
Loop While Not d Is Nothing And d.Address <> firstAddress
End If
End With
MsgBox sat & " adet bulundu"
End Sub
Aşağıdaki kod ile aranan değeri bulup renklendiriliyor, ancak kod bu haliyle belirli bir aralığı buluyor,
İstediğim; F3:K yada F3:K300 aralığında istenen veriyi bulup renklendirmesi,
Ancak bir nüans var, aranılan sayı 5 ise sadece 5'leri bulmalı, 15, 25, 52 gibi sayıları renklendirmemeli,
Teşekkür ederim.
Sub BUL()
yer = WorksheetFunction.CountA(Columns("F"))
Range("F3:K" & yer).Interior.ColorIndex = 2
ad = InputBox("aranacak değeri yazınız.", "DEĞER", "")
If ad = "" Then
MsgBox "İşlemi iptal ettiniz"
Exit Sub
End If
sat = 0
With Range("F3:K" & WorksheetFunction.CountA(Rows(1)) + 2)
Set d = .Find(ad, LookIn:=xlValues)
If Not d Is Nothing Then
firstAddress = d.Address
Do
d.Interior.ColorIndex = 3 'buradaki sayı renkleri göstermektedir.
sat = sat + 1
Set d = .FindNext(d)
Loop While Not d Is Nothing And d.Address <> firstAddress
End If
End With
MsgBox sat & " adet bulundu"
End Sub
