süzme işlemi

Katılım
25 Aralık 2005
Mesajlar
219
Sayın Orion2 nin daha önce listviewde süzme yapmak için yazmış olduğu bu kodları listbox için düzenleyerek userformdaki mevcut textbox veya combobox ile listbox1 da süzme işlemini yapabilirmiyiz.
Sub Filtrele()
Dim s1 As Worksheet
Dim uf As Object
Dim i As Variant
Set s1 = Sheets("vizdef")
Set uf = UserForm1
son = s1.Cells(65536, 1).End(xlUp).Row
With uf.ListView3
.ListItems.Clear
For i = 2 To son
If s1.Cells(i, 2) = uf.TextBox1 Or uf.TextBox1 = Empty Then
If s1.Cells(i, 3) & "" = uf.TextBox2 Or uf.TextBox2 = Empty Then
If s1.Cells(i, 4) & "" = uf.TextBox3 Or uf.TextBox3 = Empty Then
If s1.Cells(i, 5) = uf.TextBox4 Or uf.TextBox4 = Empty Then
If s1.Cells(i, 6) = uf.TextBox5 Or uf.TextBox5 = Empty Then
If s1.Cells(i, 7) & "" = uf.TextBox6 Or uf.TextBox6 = Empty Then
If s1.Cells(i, 8) & "" = uf.TextBox7 Or uf.TextBox7 = Empty Then
If s1.Cells(i, 9) = uf.TextBox8 Or uf.TextBox8 = Empty Then
If s1.Cells(i, 10) = uf.TextBox9 Or uf.TextBox9 = Empty Then
If s1.Cells(i, 11) = uf.ComboBox1 Or uf.ComboBox1 = Empty Then
If s1.Cells(i, 12) = uf.TextBox10 Or uf.TextBox10 = Empty Then
If s1.Cells(i, 13) = uf.TextBox11 Or uf.TextBox11 = Empty Then
If s1.Cells(i, 14) = uf.TextBox12 Or uf.TextBox12 = Empty Then
If s1.Cells(i, 15) = uf.TextBox13 Or uf.TextBox13 = Empty Then

.ListItems.Add , , s1.Cells(i, 1)
x = x + 1
With .ListItems(x).ListSubItems
.Add , , s1.Cells(i, 2)
.Add , , s1.Cells(i, 3)
.Add , , s1.Cells(i, 4)
.Add , , s1.Cells(i, 5)
.Add , , s1.Cells(i, 6)
.Add , , s1.Cells(i, 7)
.Add , , s1.Cells(i, 8)
.Add , , s1.Cells(i, 9)
.Add , , s1.Cells(i, 10)
.Add , , s1.Cells(i, 11)
.Add , , s1.Cells(i, 12)
.Add , , s1.Cells(i, 13)
.Add , , s1.Cells(i, 14)
.Add , , i
End With
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
Next i
End With
Set s1 = Nothing
End Sub
 
Katılım
25 Aralık 2005
Mesajlar
219
yukarıdaki sayın orion2 bu kodlarıyla userformadaki her textbox ile sorgulama yaparak listview de gösteriyorum ve gayet güzel de çalışıyor. Ama asıl sorun listview nesinesinin kullanımında... veri tabanı büyüdükçe verilerin yüklenmesi ve sorgulama çok ağırlaşıyor. sayın levent beyin bir yazısında listview yerine listbox kullanmanın daha iyi olacağını okumuştum.. Forumdaki listbox ile ilgili örnekleri inceledim. ancak her textbox la sorgulama yapılan ( başka bir sayfaya kopyala yapıştırma yapmayan) bir örneğe raslamadım.
sorun yukarıda anlatmaya çalıştığım gibi her textbox ile sorgulama yapıp bunu listbox da göstermek. veya büyük veri tabanında nasıl bir sorgulama önerirsiniz.
saygılarımla
 

teknikyapı

Altın Üye
Katılım
30 Nisan 2007
Mesajlar
396
Excel Vers. ve Dili
Office 365
Altın Üyelik Bitiş Tarihi
13-01-2026
Merhaba.
Ekteki örnekte listbox a iki opsiyonlu süzme yapabilirsiniz.
 
Üst