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
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