• DİKKAT

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

Listboxta Veri Arama

Katılım
20 Ekim 2021
Mesajlar
104
Excel Vers. ve Dili
TR 2016
ANA LISTE isimli sayfadaki verileri başlıkları olmadan listboxa alıp daha sonra textbox1e yazdığım veriyi ŞİRKET ve MÜDÜRLÜK sütunlarında aratarak süzmek istiyorum. Arama yaparken aranacak veriyi kelimelerin içinde değilde ilk üç harfe göre aratmak istiyorum. Bu konuda yardımcı olursanız sevinirim. Saygılar
 

Ekli dosyalar

Merhaba;
Userforma bir buton ekleyerek deneyin.

Private Sub getir_butonu_Click()
ListBox1.Clear
Dim i
For i = 2 To Range("d65536").End(xlUp).Row
If Left(Cells(i, "d"), Len(TextBox1)) = TextBox1 Or Left(Cells(i, "f"), Len(TextBox1)) = TextBox1 And TextBox1 <> "" Then
ListBox1.ColumnCount = 7
ListBox1.AddItem
ListBox1.List(ListBox1.ListCount - 1, 0) = Cells(i, "a")
ListBox1.List(ListBox1.ListCount - 1, 1) = Cells(i, "b")
ListBox1.List(ListBox1.ListCount - 1, 2) = Cells(i, "c")
ListBox1.List(ListBox1.ListCount - 1, 3) = Cells(i, "d")
ListBox1.List(ListBox1.ListCount - 1, 4) = Cells(i, "e")
ListBox1.List(ListBox1.ListCount - 1, 5) = Cells(i, "f")
ListBox1.List(ListBox1.ListCount - 1, 6) = Cells(i, "g")
End If
If TextBox1 = "" Then
ListBox1.ColumnCount = 7
ListBox1.AddItem
ListBox1.List(ListBox1.ListCount - 1, 0) = Cells(i, "a")
ListBox1.List(ListBox1.ListCount - 1, 1) = Cells(i, "b")
ListBox1.List(ListBox1.ListCount - 1, 2) = Cells(i, "c")
ListBox1.List(ListBox1.ListCount - 1, 3) = Cells(i, "d")
ListBox1.List(ListBox1.ListCount - 1, 4) = Cells(i, "e")
ListBox1.List(ListBox1.ListCount - 1, 5) = Cells(i, "f")
ListBox1.List(ListBox1.ListCount - 1, 6) = Cells(i, "g")
End If
Next i
End Sub

İyi çalışmalar.

Not:
 
Merhaba;
Userforma bir buton ekleyerek deneyin.

Private Sub getir_butonu_Click()
ListBox1.Clear
Dim i
For i = 2 To Range("d65536").End(xlUp).Row
If Left(Cells(i, "d"), Len(TextBox1)) = TextBox1 Or Left(Cells(i, "f"), Len(TextBox1)) = TextBox1 And TextBox1 <> "" Then
ListBox1.ColumnCount = 7
ListBox1.AddItem
ListBox1.List(ListBox1.ListCount - 1, 0) = Cells(i, "a")
ListBox1.List(ListBox1.ListCount - 1, 1) = Cells(i, "b")
ListBox1.List(ListBox1.ListCount - 1, 2) = Cells(i, "c")
ListBox1.List(ListBox1.ListCount - 1, 3) = Cells(i, "d")
ListBox1.List(ListBox1.ListCount - 1, 4) = Cells(i, "e")
ListBox1.List(ListBox1.ListCount - 1, 5) = Cells(i, "f")
ListBox1.List(ListBox1.ListCount - 1, 6) = Cells(i, "g")
End If
If TextBox1 = "" Then
ListBox1.ColumnCount = 7
ListBox1.AddItem
ListBox1.List(ListBox1.ListCount - 1, 0) = Cells(i, "a")
ListBox1.List(ListBox1.ListCount - 1, 1) = Cells(i, "b")
ListBox1.List(ListBox1.ListCount - 1, 2) = Cells(i, "c")
ListBox1.List(ListBox1.ListCount - 1, 3) = Cells(i, "d")
ListBox1.List(ListBox1.ListCount - 1, 4) = Cells(i, "e")
ListBox1.List(ListBox1.ListCount - 1, 5) = Cells(i, "f")
ListBox1.List(ListBox1.ListCount - 1, 6) = Cells(i, "g")
End If
Next i
End Sub

İyi çalışmalar.

Not:
teşekkürler
 
Geri
Üst