• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Ara - Boya Isleminde Bulamadiginda hata Istiyorum

Katılım
21 Ekim 2008
Mesajlar
2,323
Excel Vers. ve Dili
Office 2013 - Eng
Arkadaslar 2 buton ve 1 textboxtan olusan bir arama boyama makrosu var elimde arama gerceklestiginde sonuc bulunamazsa sonuc bulunamadi ve bulundugunda diyelim 3 arama boyandi gibisinde mesaj verebilirmi acaba ?
 

Ekli dosyalar

Ara butonundaki kodu aşağıdaki ile değiştirerek deneyin. Kırmızı renkli satırlar eklenmiştir.

Kod:
Private Sub CommandButton1_Click()
With Application.ReplaceFormat.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
aranan = TextBox1.Value
Cells.Replace What:=aranan, Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
 
[COLOR=red]say = WorksheetFunction.CountIf([b8:b65536], TextBox1 & "*")[/COLOR]
[COLOR=red]If say = 0 Then[/COLOR]
[COLOR=red]MsgBox "Sonuç Bulunamadı.", 32, "Sonuç"[/COLOR]
[COLOR=red]Else[/COLOR]
[COLOR=red]MsgBox say & " adet sonuç bulundu.", 32, "Sonuç"[/COLOR]
[COLOR=red]End If[/COLOR]
End Sub
 
Tesekkur ederim Levent Menteşoğlu cok yararli oldu, elinize saglik..
 
Geri
Üst