• DİKKAT

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

ComboBox'tan seçilene göre ListBox'ta Listeleme

  • Konbuyu başlatan Konbuyu başlatan teksen
  • Başlangıç tarihi Başlangıç tarihi
Katılım
6 Mart 2006
Mesajlar
251
Arkadaşlar merhaba,

Ara isimli Frame'de bulunan ComboBox'tan seçtiğim seçeneğe göre ListBox'ta nasıl listeleyebilir acaba?

Şimdiden teşekkürler.
 
Selamlar,

Seçim yaptığınız ComboBox2 'ye aşağıdaki kodu uygulayın.

Kod:
Private Sub ComboBox2_Change()
    ListBox1.RowSource = ""
    Son = [Sayfa1!A65536].End(3).Row
    ListBox1.ColumnCount = 7
    ListBox1.ColumnWidths = "0;75;75;75;75;75;75"
    For X = 2 To Son
    If Sheets("Sayfa1").Cells(X, "F") = ComboBox2.Value Then
    ListBox1.AddItem
    ListBox1.List(S, 0) = X
    ListBox1.List(S, 1) = Sheets("Sayfa1").Cells(X, "A")
    ListBox1.List(S, 2) = Sheets("Sayfa1").Cells(X, "B")
    ListBox1.List(S, 3) = Sheets("Sayfa1").Cells(X, "C")
    ListBox1.List(S, 4) = Sheets("Sayfa1").Cells(X, "D")
    ListBox1.List(S, 5) = Sheets("Sayfa1").Cells(X, "E")
    ListBox1.List(S, 6) = Sheets("Sayfa1").Cells(X, "F")
    S = S + 1
    End If
    Next
End Sub

ListBox1 'in Click olayındaki koduda aşağıdaki şekilde değiştirerek denermisiniz.

Kod:
Private Sub ListBox1_Click()
    If ComboBox2 = "" Then
    TextBox1 = Sheets("Sayfa1").Cells(ListBox1.ListIndex + 2, "A")
    TextBox2 = Sheets("Sayfa1").Cells(ListBox1.ListIndex + 2, "B")
    TextBox3 = Sheets("Sayfa1").Cells(ListBox1.ListIndex + 2, "C")
    TextBox4 = Sheets("Sayfa1").Cells(ListBox1.ListIndex + 2, "D")
    TextBox5 = Sheets("Sayfa1").Cells(ListBox1.ListIndex + 2, "E")
    ComboBox1 = Sheets("Sayfa1").Cells(ListBox1.ListIndex + 2, "F")
    Else
    TextBox1 = Sheets("Sayfa1").Cells(ListBox1.Value, "A")
    TextBox2 = Sheets("Sayfa1").Cells(ListBox1.Value, "B")
    TextBox3 = Sheets("Sayfa1").Cells(ListBox1.Value, "C")
    TextBox4 = Sheets("Sayfa1").Cells(ListBox1.Value, "D")
    TextBox5 = Sheets("Sayfa1").Cells(ListBox1.Value, "E")
    ComboBox1 = Sheets("Sayfa1").Cells(ListBox1.Value, "F")
    End If
End Sub
 
Son düzenleme:
Yardımlarınız için teşekkür ederim
 
Geri
Üst