- Katılım
- 24 Aralık 2020
- Mesajlar
- 108
- Excel Vers. ve Dili
- excel 2010
- Altın Üyelik Bitiş Tarihi
- 01-01-2022
Arkadaşlar merhaba Listbox da bi videodan örnek alarak aşağıdaki kodları yazdım liste 2 sütunda çalıştı ama 16 sütun var gelmesini istediğim ve burda 1.sütünda arama yapıyor. A sütünunda arama yapmak istediğim sütün O sütünü bu konuda yardımcı olurmusunuz..
Private Sub ListBox1_Click()
End Sub
Private Sub TextBox1_Change()
Dim i As Long
Me.TextBox1 = Format(StrConv(Me.TextBox1, vbLowerCase))
Me.ListBox1.Clear
Me.ListBox1.AddItem "DURUMU"
Me.ListBox1.List(0, 1) = "FİRMA ADI"
Me.ListBox1.Selected(0) = True
For i = 2 To Sayfa1.Range("A1000000").End(xlUp).Row
For x = 1 To Len(Sayfa1.Cells(i, 1))
a = Me.TextBox1.TextLength
If LCase(Mid(Sayfa1.Cells(i, 1), x, a)) = Me.TextBox1 And Me.TextBox1 <> "" Then
Me.ListBox1.AddItem Sayfa1.Cells(i, 1)
Me.ListBox1.List(ListBox1.ListCount - 1, 1) = "" & Sayfa1.Cells(i, 2)
End If
Next x
Next i
End Sub
Private Sub ListBox1_Click()
End Sub
Private Sub TextBox1_Change()
Dim i As Long
Me.TextBox1 = Format(StrConv(Me.TextBox1, vbLowerCase))
Me.ListBox1.Clear
Me.ListBox1.AddItem "DURUMU"
Me.ListBox1.List(0, 1) = "FİRMA ADI"
Me.ListBox1.Selected(0) = True
For i = 2 To Sayfa1.Range("A1000000").End(xlUp).Row
For x = 1 To Len(Sayfa1.Cells(i, 1))
a = Me.TextBox1.TextLength
If LCase(Mid(Sayfa1.Cells(i, 1), x, a)) = Me.TextBox1 And Me.TextBox1 <> "" Then
Me.ListBox1.AddItem Sayfa1.Cells(i, 1)
Me.ListBox1.List(ListBox1.ListCount - 1, 1) = "" & Sayfa1.Cells(i, 2)
End If
Next x
Next i
End Sub