KoNFiCuS
Altın Üye
- Katılım
- 18 Mayıs 2011
- Mesajlar
- 69
- Excel Vers. ve Dili
- Office 365 TR - 64 Bit
- Altın Üyelik Bitiş Tarihi
- 08-03-2028
Merhaba Üstadlar,
Eski kullanmış olduğum bir ListBox objesinde arama yapılan text soldan sağa aynı olması gerekiyordu, aşağıdaki kodu içerisinde geçen kelimelere göre arama yapacağı şekilde nasıl güncelleyebilirim?
ayrıca Offset deki 2. seçenek yani "ListBox1.List(ListBox1.ListCount - 1, 2) = oteladi.Offset(0, 2)" bu listbox a gelmiyor.
Eski kullanmış olduğum bir ListBox objesinde arama yapılan text soldan sağa aynı olması gerekiyordu, aşağıdaki kodu içerisinde geçen kelimelere göre arama yapacağı şekilde nasıl güncelleyebilirim?
Kod:
Private Sub TextBox1_Change()
On Error GoTo yok
Dim oteladi As Range
ListBox1.Clear
For Each oteladi In ThisWorkbook.Worksheets("PivotDB").Range("AV2:AV" & ThisWorkbook.Worksheets("PivotDB").Range("AV65530").End(1).Row)
If InStr(1, oteladi, TextBox1.Text, vbTextCompare) > 0 Then
ListBox1.AddItem
ListBox1.List(ListBox1.ListCount - 1, 0) = oteladi
ListBox1.List(ListBox1.ListCount - 1, 1) = oteladi.Offset(0, 1)
ListBox1.List(ListBox1.ListCount - 1, 2) = oteladi.Offset(0, 2)
End If
Next oteladi
Exit Sub
yok:
ListBox1.Clear
End Sub