• DİKKAT

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

listview e aktarma sorunu

Katılım
24 Kasım 2010
Mesajlar
20
Excel Vers. ve Dili
2003
selam. Makrolarda yeniyim. Aşağıdaki gibi bir kod buldum. Ama listview e aktarırken sorun oluyor; 8 nolu öğrenciyi aktar deyince 882, 801, 889 vb. tüm kayıtları getiriyor. Yani içinde 8 olan tüm numaraları listeliyor. Bunu düzeltebilir miyim?




Private Sub CommandButton4_Click()
Dim sorgu, sorgu2 As Variant

Set sh = Sheets("Sayfa4")

sorgu = UCase(Replace(Replace(Me.TextBox1.Value, "i", "İ"), "ı", "I"))
son = sh.Cells(65536, "A").End(xlUp).Row
UserForm1.ListView1.ListItems.Clear

For i = 2 To son

If UCase(Replace(Replace(sh.Cells(i, 2).Value, "i", "İ"), "ı", "I")) Like "*" & sorgu & "*" Then

With UserForm1.ListView1
.ListItems.Add , , sh.Cells(i, 1)
x = x + 1
With .ListItems(x)
.SubItems(1) = sh.Cells(i, 2)
.SubItems(2) = sh.Cells(i, 3)
.SubItems(3) = sh.Cells(i, 4)
.SubItems(4) = sh.Cells(i, 5)


End With
End With
End If
Next i


End Sub


şimdiden teşekkür ederim.
 
Kod:
If UCase(Replace(Replace(sh.Cells(i, 2).Value, "i", "İ"), "ı", "I")) Like "*" & sorgu & "*" Then

Yukarıdaki satırı aşağıdaki ile değiştirerek deneyin.

Kod:
If UCase(Replace(Replace(sh.Cells(i, 2).Value, "i", "İ"), "ı", "I")) = sorgu Then
 
teşekkür ederim. Ellerine sağlık..
 
Geri
Üst