• DİKKAT

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

ListBox da AddItem ile Listelemede 10 sütundan fazla nasıl olur?

  • Konbuyu başlatan Konbuyu başlatan ocamsul
  • Başlangıç tarihi Başlangıç tarihi
Katılım
19 Ocak 2005
Mesajlar
940
Excel Vers. ve Dili
İŞ : Microsoft Office Excel 2003
EV : Microsoft Office Excel 2003
Arkadaşlar iyi çalışmalar.

ListBox da AddItem ile Listelemede 10 sütundan daha fazla sütunu RowSource özelliği hariç nasıl listeleyebiliriz?

Kod:
[COLOR="Blue"][/COLOR]
Private Sub UserForm_Initialize()
ListBox1.ColumnCount = 12
For SUT = 1 To Cells(65536, "A").End(3).Row
ListBox1.AddItem
ListBox1.List(S, 0) = Cells(SUT, "A")
ListBox1.List(S, 1) = Cells(SUT, "B")
ListBox1.List(S, 2) = Cells(SUT, "C")
ListBox1.List(S, 3) = Cells(SUT, "D")
ListBox1.List(S, 4) = Cells(SUT, "E")
ListBox1.List(S, 5) = Cells(SUT, "F")
ListBox1.List(S, 6) = Cells(SUT, "G")
ListBox1.List(S, 7) = Cells(SUT, "H")
ListBox1.List(S, 8) = Cells(SUT, "I")
ListBox1.List(S, 9) = Cells(SUT, "J")
[COLOR="Red"]'ListBox1.List(S, 10) = Cells(SUT, "K")
'ListBox1.List(S, 11) = Cells(SUT, "L")[/COLOR]
S = S + 1
Next
End Sub
 
:cool:
Kod:
Private Sub UserForm_Initialize()
ListBox1.ColumnCount = 12
ListBox1.List = Range("A1:L" & Cells(65536, "A").End(xlUp).Row).Value
End Sub
 
SN: Evren Gizler; Üstadım teşekkür ederim.
 
Listbox mantığını anlamanın en güzel yolu , teşekkürler Evren Bey
 
Combooxtan seçilen sayfaya göre Listbox a Seçim istenildiğinde ise nasıl yapmalıyız.

:cool:
Kod:
Private Sub UserForm_Initialize()
ListBox1.ColumnCount = 12
ListBox1.List = Range("A1:L" & Cells(65536, "A").End(xlUp).Row).Value
End Sub

Hocam merhabalar.
Comboboxtan seçilen sayfaya göre Listbox a Seçim aktarılmak istenildiğinde ise yukarıdaki kodda nasıl bir değişiklik yapmalıyız

Sayfalarımız Ocak Şubat Mart Nisan
Örnek Comboboxtan seçilen sayfa Ocak


With Sheets(ComboBox1.Text).Select

ListBox1.ColumnCount = 5
ListBox1.List = Range("A3:E" & Cells(65536, "A").End(xlUp).Row).Value

End With

yazdığımda kod Run Time Erro hatası vermektedir ?
 
Merhaba,

Bu şekilde kullanın.

Kod:
Private Sub ComboBox1_Change()
    With Sheets(ComboBox1.Text)
        ListBox1.ColumnCount = 5
        ListBox1.List = .Range("A3:E" & .Cells(65536, "A").End(xlUp).Row).Value
    End With
End Sub
 
Hocam aynı Hata Halne devam ediyor

Merhaba,

Bu şekilde kullanın.

Kod:
Private Sub ComboBox1_Change()
    With Sheets(ComboBox1.Text)
        ListBox1.ColumnCount = 5
        ListBox1.List = .Range("A3:E" & .Cells(65536, "A").End(xlUp).Row).Value
    End With
End Sub



Private Sub TxtAra_Change()
Dim sat, s As Variant
Dim deg1, deg2, deg3 As String


With ListBox1
.Clear
.ColumnCount = 37
'.ColumnWidths = "38;120;145;90;170;0;0"

End With


For sat = 2 To Cells(65536, "B").End(xlUp).Row

deg1 = UCase(Replace(Replace(Cells(sat, "B"), "ı", "I"), "i", "İ"))
deg3 = UCase(Replace(Replace(Cells(sat, "a"), "ı", "I"), "i", "İ"))
deg2 = UCase(Replace(Replace(TxtAra, "ı", "I"), "i", "İ"))
If deg1 & deg3 Like "*" & deg2 & "*" Then

ListBox1.AddItem

ListBox1.List(s, 0) = Cells(sat, "A") 'Sıra No
ListBox1.List(s, 1) = Cells(sat, "B") 'Öğrenci No
ListBox1.List(s, 2) = Cells(sat, "C") 'Adı ve Soyadı
ListBox1.List(s, 3) = Cells(sat, "D") 'Ders Durumu
ListBox1.List(s, 4) = Cells(sat, "E") 'Dersin Adı

ListBox1.List(s, 5) = Cells(sat, "F")
ListBox1.List(s, 6) = Cells(sat, "G")
ListBox1.List(s, 7) = Cells(sat, "H")
ListBox1.List(s, 8) = Cells(sat, "I")
ListBox1.List(s, 9) = Cells(sat, "J")
''ListBox1.List(s, 10) = Cells(sat, "K") ' bu satır sonrası göçüyor nerede hata yapıyorum ?

s = s + 1
End If: Next
Application.ScreenUpdating = False
End Sub


'***** listboxu yenilemek için ****

Private Sub UserForm_Initialize()

TxtAra = ".": TxtAra = ""

End Sub
 
''ListBox1.List(s, 10) = Cells(sat, "K") ' bu satır sonrası göçüyor nerede hata yapıyorum ?
11 sütun yapar.10 sütundan fazla listelemeyezsiniz add item ile.:cool:
 
Geri
Üst