• DİKKAT

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

combobox tan listboxa aktarırken sadece son veriyi gösterme hatası

zulfuernek

Altın Üye
Katılım
24 Haziran 2017
Mesajlar
761
Excel Vers. ve Dili
türkçe
aşağıdaki kodları comboboxta seçim yaptığımda verileri listboxa aktarma yapıyor ancak sadece comboboxtaki seçili değerin son satırını gösteriyor.
SORU: seçili değerlere ait tüm verileri listelesin



Private Sub ComboBox6_Change()
On Error Resume Next
ListBox2.RowSource = Empty
ListBox2.ColumnCount = 6
ListBox2.ColumnHeads = True
ListBox2.Clear
For Each isim In Sheets("KAYIT").Range("B3:B" & Sheets("KAYIT").Range("B65536").End(xlUp).Row)
If UCase(LCase(isim)) Like UCase(LCase(ComboBox6)) & "*" Then
liste = ListBox1.ListCount
ListBox2.AddItem
ListBox2.List(liste, 0) = isim.Offset(0, 0)
ListBox2.List(liste, 1) = isim.Offset(0, 3)
ListBox2.List(liste, 2) = isim.Offset(0, 4)
ListBox2.List(liste, 3) = isim.Offset(0, 7)
ListBox2.List(liste, 4) = isim.Offset(0, 8)
ListBox2.List(liste, 5) = isim.Offset(0, 9)
End If
Next
End Sub
 
aşağıdaki kodları comboboxta seçim yaptığımda verileri listboxa aktarma yapıyor ancak sadece comboboxtaki seçili değerin son satırını gösteriyor.
SORU: seçili değerlere ait tüm verileri
Aşağıdaki şekilde deneyiniz.:cool:


Rich (BB code):
Private Sub ComboBox6_Change()

On Error Resume Next
x =0
ListBox2.RowSource = Empty

ListBox2.ColumnCount = 6

   ListBox2.ColumnHeads = True

ListBox2.Clear



For Each isim In Sheets("KAYIT").Range("B3:B" & Sheets("KAYIT").Range("B65536").End(xlUp).Row)

    If UCase(LCase(isim)) Like UCase(LCase(ComboBox6)) & "*" Then

           

            ListBox2.AddItem

            ListBox2.List(x, 0) = isim.Offset(0, 0)

            ListBox2.List(x, 1) = isim.Offset(0, 3)

            ListBox2.List(x, 2) = isim.Offset(0, 4)

            ListBox2.List(x, 3) = isim.Offset(0, 7)

            ListBox2.List(x, 4) = isim.Offset(0, 8)

            ListBox2.List(x, 5) = isim.Offset(0, 9)
            x= x +1

      End If

Next

End Sub
 
#2 numaralı mesajda kodları güncelledim.
Tekrar deneyiniz.:cool:
 
Private Sub ComboBox6_Change()
On Error Resume Next
ListBox2.RowSource = Empty
ListBox2.ColumnCount = 6
ListBox2.ColumnHeads = True
ListBox2.Clear
For Each isim In Sheets("KAYIT").Range("B3:B" & Sheets("KAYIT").Range("B65536").End(xlUp).Row)
If UCase(LCase(isim)) Like UCase(LCase(ComboBox6)) & "*" Then
liste = ListBox2.ListCount
ListBox2.AddItem
ListBox2.List(liste, 0) = isim.Offset(0, 0)
ListBox2.List(liste, 1) = isim.Offset(0, 3)
ListBox2.List(liste, 2) = isim.Offset(0, 4)
ListBox2.List(liste, 3) = isim.Offset(0, 7)
ListBox2.List(liste, 4) = isim.Offset(0, 8)
ListBox2.List(liste, 5) = isim.Offset(0, 9)
End If
Next
End Sub

kırmızı yerde listbox 1 yazmışım yanlışlıkla
 
#2 numaralı mesajımı tekrar denedinizmi?:cool:
 
hocam listbox üst satırında çizgi çıkıyor onu nasıl silebilirim
 
Orion hocam bir çok projeme çözüm oldunuz. her daim müteşekkirim.

örnek dosyayı ekte gönderdim.

SORUN 1: userform açılınca jayıt sayfasının tamamını gösteriyor. (göstermemesi lazım. listbox boş olarak gelsin)
SORUN 2: listboş başlık kısmını hallettim ancak başlık çerçevesi görünüyor. (başlık çizgileri hiçbir zaman görünmesin)

saygılarımla
 

Ekli dosyalar

Geri
Üst