• DİKKAT

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

Soru Listbox arama (Harf Duyarlı)

sirkülasyon

Altın Üye
Katılım
10 Temmuz 2012
Mesajlar
2,543
Excel Vers. ve Dili
2021 LTSC TR
Kod:
Sub filtrele()
    ListBox1.List = liste
    If TextBox9 <> "" Then
        For i = ListBox1.ListCount - 1 To 0 Step -1
            If Not (ListBox1.List(i, 0) Like "*" & TextBox9.Text & "*") Then
                ListBox1.RemoveItem (i)
            End If
        Next
    End If
End Sub

Rica etsem yukarıdaki koda büyük küçük harfe duyarlı olabilmesini ekleyebilir misiniz?
 
If Not (ucase(ListBox1.List(i, 0)) Like "*" & ucase(TextBox9.Text) & "*") Then

Şeklinde dener misiniz?
 
Yusuf Abi
İlk harf büyük olursa süzüyor. Küçük harf ile işlem yapmıyor
 
Aşağıdaki kod işinize yarayabilir.
Kod:
 If TextBox9 <> "" Then
        For i = ListBox1.ListCount - 1 To 0 Step -1
        
        If TextBox1 <> ListBox1.List(i, 0) And Replace(UCase(ListBox1.List(i, 0)), "I", "İ") = Replace(UCase(TextBox9.Text), "I", "İ") Then
          ListBox1.RemoveItem (i)
        End If
        Next
    End If
 
Yanlış anladım herhalde, hangisi işinize yarasa.
Kod:
If TextBox9 <> "" Then
        For i = ListBox1.ListCount - 1 To 0 Step -1
        If Replace(UCase(ListBox1.List(i, 0)), "I", "İ") <> Replace(UCase(TextBox9.Text), "I", "İ") Then
          ListBox1.RemoveItem (i)
        End If
        Next
    End If
 
Yukardaki kod, İngilizcedeki i- kullanımı nedeni ile , kıl > kil gibi kelimeleri ayırt edemiyordu.
Kod:
If TextBox9 <> "" Then
        Text = Replace(Replace(TextBox9.Text, "i", "İ"), "ı", "I")
        For i = ListBox1.ListCount - 1 To 0 Step -1
        List = Replace(Replace(ListBox1.List(i, 0), "i", "İ"), "ı", "I")
        If UCase(Text) <> UCase(List) Then
          ListBox1.RemoveItem (i)
        End If
        Next
    End If
 
Geri
Üst