1. Yöntem ListBox.RowSource
Bu yöntemle bir sayfadaki alanı olduğu gibi listboxta görüntüleyebiliriz.
Kod:
Dim Sons As Long
ListBox1.ColumnHeads = True
ListBox1.ColumnCount = 2
Sons = Sheets(1).Range("A65536").End(xlUp).Row
ListBox1.RowSource = "Veri!A2:B" & Sons
2. Yöntem AddItem
AddItem komutu ListBoxun sonuna boş bir satır ekleyecektir.
Bu metodla listboxa veriyi tek tek ekleriz ki bu sebeble yükleme işlemi biraz hantal olur
ListBox1.AddItem Değişken
ListBox1.AddItem
ListBox1.List(0,0)=Değişken
Dim Sons, Satir As Long
ListBox1.Clear
ListBox1.ColumnWidths = "30;55"
ListBox1.ColumnCount = 2
Sons = Sheets(1).Range("A65536").End(xlUp).Row
For Satir = 2 To Sons
ListBox1.AddItem
ListBox1.List(ListBox1.ListCount - 1, 0) = Sheets(1).Cells(Satir, 1)
ListBox1.List(ListBox1.ListCount - 1, 1) = Sheets(1).Cells(Satir, 2)
Next Satir
3. Yöntem Diziden veya Alandan (Range) den ListBox Doldurmak.
[code]
Dim Sons, Satir As Long
ListBox1.Clear
ListBox1.ColumnWidths = "30;55"
ListBox1.ColumnCount = 2
Sons = Sheets(1).Range("A65536").End(xlUp).Row
ReDim Dizi(Sons - 2, 2)
For Satir = 2 To Sons
Dizi(Satir - 2, 0) = Sheets(1).Cells(Satir, 1)
Dizi(Satir - 2, 1) = Format(Sheets(1).Cells(Satir, 2), "dd.mm.yyyy")
Next Satir
ListBox1.List() = Dizi()
Bu yöntemlerden birini uygulayabilirsin.