• DİKKAT

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

form üzerinde textboxa girilen harflere göre listboxtan süzme

Günaydın ,
açıklama dosya içinde

Teşekkürler

Kısa açıklamanızı mesajınıza yazınız dolayızıyla çözüm bulamıyacağımız dozyalarınızı boşuna indirmemiş oluruz. zira kota sorunu var.


Aşağıdaki kodu denermisiniz.?
2 adet OptionButton1,OptionButton2 nesnelerini ekleyiniz.

Kod:
Private Sub TextBox1_Change()
If OptionButton1.Value = True Then
sirala1_Click
Else
sirala2_Click
End If
End Sub
Private Sub sirala1_Click()
Dim i As Integer
Dim j As Integer
Dim s As String
Dim sat As Integer
Dim sat1 As String
Dim deg As String
Firma_List.Clear
Firma_List.ColumnCount = 2
Firma_List.ColumnWidths = "100;0;0" 'lisbox'taki sütunların genişliği
sat1 = 0
sat = 2
j = Len(TextBox1.Text)
For i = 2 To Worksheets("Sayfa1").[b65536].End(3).Row
s = LCase(Mid(Sheets("Sayfa1").Cells(i, sat).Value, 1, j))
If Worksheets("Sayfa1").Cells(i, 1).Value > 0 Then
If TextBox1.Text <> "" Then
If s = LCase(TextBox1.Text) Then
Firma_List.AddItem
Firma_List.List(sat1, 0) = Sheets("Sayfa1").Cells(i, sat).Value
Firma_List.List(sat1, 1) = i
sat1 = sat1 + 1
End If
Else
Firma_List.AddItem
Firma_List.List(sat1, 0) = Sheets("Sayfa1").Cells(i, sat).Value
Firma_List.List(sat1, 1) = i
sat1 = sat1 + 1
End If
End If
Next
End Sub
Private Sub sirala2_Click()
Dim i As Integer
Dim j As Integer
Dim s As String
Dim sat As Integer
Dim sat1 As String
Dim deg As String
Firma_List.Clear
Firma_List.ColumnCount = 2
Firma_List.ColumnWidths = "100;0;0" 'lisbox'taki sütunların genişliği
sat1 = 0
sat = 2
j = Len(TextBox1.Text)
For i = 2 To Worksheets("Sayfa1").[b65536].End(3).Row
s = LCase(TextBox1.Text)
If Worksheets("Sayfa1").Cells(i, 1).Value > 0 Then
If TextBox1.Text <> "" Then
deg = 0
For j = 1 To Len(Sheets("Sayfa1").Cells(i, sat).Value)
If s = LCase(Mid(Sheets("Sayfa1").Cells(i, sat).Value, j, Len(TextBox1.Text))) Then
deg = 1
End If
Next
If deg = 1 Then
Firma_List.AddItem
Firma_List.List(sat1, 0) = Sheets("Sayfa1").Cells(i, sat).Value
Firma_List.List(sat1, 1) = i
sat1 = sat1 + 1
End If
Else
Firma_List.AddItem
Firma_List.List(sat1, 0) = Sheets("Sayfa1").Cells(i, sat).Value
Firma_List.List(sat1, 1) = i
sat1 = sat1 + 1
End If
End If
Next
End Sub
 
çok teşekkür ederim,
uyarı konusunda haklısınız
 
Geri
Üst