• DİKKAT

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

listboxta boş hücreler listelenmesin

Katılım
8 Nisan 2005
Mesajlar
77
aşağıdaki kodlar ile listboxa listelenen verilerde boş olan hücreleri boş olarak gösteriyor. eğer mümkün ise listbox aralarda boş olan hücreleri göstermeyip sadece veri olan hücreleri alt alta listelesin

ilgilenen arkadaşlara şimdiden teşekkürler.

vba kodu:

ListBox1.AddItem (Cells(i, 11).Value)
 
Kodu bir if komutunun içine alırsanız boşlukları pas geçebilirsiniz.

[vb:1:1096ad8243]If Cells(i, 11).value <> "" Then
ListBox1.AddItem Cells(i, 11).Value
End If
[/vb:1:1096ad8243]
 
sayın leventm ben bu kodu aşağıdaki gibi kullanıyorum ama burada nereye yazacağıma karar veremedim yardımcı olabilirmisin?


Private Sub ComboBox1_Change()
ListBox1.Clear
ListBox2.Clear
ListBox3.Clear
TextBox1.Value = ListBox1.ListCount

Sheets("sayfa1").Select
For i = 1 To [B65535].End(xlUp).Row
If Cells(i, 2) = ComboBox1.Value Then

Cells

ListBox1.AddItem (Cells(i, 11).Value)
ListBox2.AddItem (Cells(i, 13).Value)
ListBox3.AddItem (Cells(i, 15).Value)

End If
Next i
TextBox1.Value = ListBox1.ListCount


End Sub
 
Aşağıdaki gibi düzenleyin.

[vb:1:682cf1c41b]Private Sub ComboBox1_Change()
ListBox1.Clear
ListBox2.Clear
ListBox3.Clear
TextBox1.Value = ListBox1.ListCount

Sheets("sayfa1").Select
For i = 1 To [B65535].End(xlUp).Row
If Cells(i, 2) = ComboBox1.Value Then

If Cells(i, 11).value <> "" Then
ListBox1.AddItem Cells(i, 11).Value
End If

ListBox2.AddItem (Cells(i, 13).Value)
ListBox3.AddItem (Cells(i, 15).Value)
End If

Next i
TextBox1.Value = ListBox1.ListCount

End Sub
[/vb:1:682cf1c41b]
 
verdiğiniz örnek kodu yazdığımda

compile error:
Invalid use property

hatasını verdi ve
For i = 1 To [B65535].End(xlUp).Row
If Cells(i, 2) = ComboBox1.Value Then


Cells (bu satırda hata verdi)

kontrol edebilirmisiniz
 
ilginize çok teşekkürler işlem tamam sağolun
 
Geri
Üst