ListBox find komutu ile arama.

Katılım
24 Kasım 2009
Mesajlar
37
Excel Vers. ve Dili
2007 prof
Merhabalar .
dogru kodu bulamadım sanıyorsam.
commandbutton ile textbox' ın değerini aratamıyorum. listboxta aratamıyorum
yardımlarınızı rica ederim.
birde 60.000 satır var çok ağır çalışıyor listbox aramada

evren bey find komutunu kullanmamı istedir fakat bu komutu hiç kullanamdım
örnek dosyam ektedir.

emeğiniz için şimdidden teşekkürler
 

Ekli dosyalar

Ömer

Moderatör
Yönetici
Katılım
18 Ağustos 2007
Mesajlar
22,184
Excel Vers. ve Dili
Microsoft 365 Tr
Ofis 2016 Tr
Merhaba,

Bu şekilde kullanabilirsiniz..

Kod:
Private Sub CommandButton109_Click()
Dim c As Range, sat As Long, ilkadres As Variant
With Range("B:B")
    Set c = .Find(TextBox1.Text, LookIn:=xlValues)
    If Not c Is Nothing Then
        ilkadres = c.Address
        Do
            With ListBox1
                .ColumnCount = 6
                .ColumnWidths = "160,140,105,80,80,300"
                .AddItem
                .List(sat, 0) = Cells(c.Row, "A")
                .List(sat, 1) = Cells(c.Row, "B")
                .List(sat, 2) = Cells(c.Row, "C")
                .List(sat, 3) = Cells(c.Row, "D")
                .List(sat, 4) = Cells(c.Row, "E")
                .List(sat, 5) = Cells(c.Row, "F")
            End With
            sat = sat + 1
            Set c = .FindNext(c)
        Loop While Not c Is Nothing And c.Address <> ilkadres
    End If
End With
End Sub
.
 
Üst