• DİKKAT

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

TextBox daki değere göre ListBoxda seçim

Katılım
8 Haziran 2007
Mesajlar
401
Excel Vers. ve Dili
excel fonksiyonlar
Forumda emeği geçen herkese merhaba. Arkadaşlar aşağıdaki kodlarla TextBox1 deki string veriye göre ListBox1 de seçim yapmak istedim. Fakat bir türlü olmadı. Bir aceminin deneyebileceği her türlü varyasyonu denedim. Denemediğim ne kalmış onu merak ediyorum.:) İlgilenen arkadaşlara şimdiden teşekkürler. Karışıklığa meydan vermemek için şöyle bir not düşeyim. Derdim süzme yapmak değil. TextBox1 de ANKARA yazıyorsa ListBox1 de ANKARA yazan satırı seçili hale getirecek. Hatta kodları iki textbox'a göre yazabilirsek daha iyi olacak.


Private Sub CommandButton1_Click()

Dim i

For i = 0 To UserForm3.ListBox1.ListCount - 1

If UserForm3.ListBox1.List(i) = UserForm3.TextBox1.Text Then
UserForm3.ListBox1.ListIndex = i
ListBox1.List(ListBox1.ListIndex, i).Select

End If

Next i
 
Merhaba..

Bunu deneyin..:

Kod:
Dim i

    For i = 0 To ListBox1.ListCount - 1

        If ListBox1.List(i) = TextBox1.Text Then
            ListBox1.ListIndex = i
            [COLOR="Red"]ListBox1.Selected(i) = -1[/COLOR]

        End If
    Next
 
Merhaba..

Bunu deneyin..:

Kod:
Dim i

    For i = 0 To ListBox1.ListCount - 1

        If ListBox1.List(i) = TextBox1.Text Then
            ListBox1.ListIndex = i
            [COLOR="Red"]ListBox1.Selected(i) = -1[/COLOR]

        End If
    Next
Hocam teşekkür ederim. :)
 
Geri
Üst