• DİKKAT

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

Listbox sorunu

Katılım
9 Kasım 2012
Mesajlar
12
Excel Vers. ve Dili
2003
Kod:
Private Sub ListBox1_Click()
TextBox1 = ListBox1.Column(0)
TextBox2 = ListBox1.Column(1)
TextBox3 = ListBox1.Column(2)
TextBox4 = ListBox1.Column(3)
TextBox5 = ListBox1.Column(4)
TextBox6 = ListBox1.Column(5)
TextBox7 = ListBox1.Column(6)
TextBox8 = ListBox1.Column(7)
TextBox9 = ListBox1.Column(8)
TextBox10 = ListBox1.Column(9)
Label58.Caption = ListBox1.Column(10)
Label59.Caption = ListBox1.Column(11)
Label60.Caption = ListBox1.Column(12)
TextBox11 = ListBox1.Column(13)
TextBox12 = ListBox1.Column(14)
TextBox13 = ListBox1.Column(15)
TextBox14 = ListBox1.Column(16)
TextBox15 = ListBox1.Column(17)
TextBox16 = ListBox1.Column(18)
End Sub


Kod:
Private Sub UserForm_Initialize()
Dim sat, s As Integer
With ListBox1
.Clear
.ColumnCount = 1
.ColumnWidths = "160"
End With
For sat = 2 To Sheets("Database").Cells(65536, "b").End(xlUp).Row
ListBox1.AddItem
ListBox1.List(s, 0) = Sheets("Database").Cells(sat, "b")
ListBox1.List(s, 1) = Sheets("Database").Cells(sat, "c")
ListBox1.List(s, 2) = Sheets("Database").Cells(sat, "d")
ListBox1.List(s, 3) = Sheets("Database").Cells(sat, "e")
ListBox1.List(s, 4) = Sheets("Database").Cells(sat, "f")
ListBox1.List(s, 5) = Sheets("Database").Cells(sat, "g")
ListBox1.List(s, 6) = Sheets("Database").Cells(sat, "h")
ListBox1.List(s, 7) = Sheets("Database").Cells(sat, "i")
ListBox1.List(s, 8) = Sheets("Database").Cells(sat, "j")
ListBox1.List(s, 9) = Sheets("Database").Cells(sat, "l")
ListBox1.List(s, 10) = Sheets("Database").Cells(sat, "m")
ListBox1.List(s, 11) = Sheets("Database").Cells(sat, "n")
ListBox1.List(s, 12) = Sheets("Database").Cells(sat, "o")
ListBox1.List(s, 13) = Sheets("Database").Cells(sat, "p")
ListBox1.List(s, 14) = Sheets("Database").Cells(sat, "q")
ListBox1.List(s, 15) = Sheets("Database").Cells(sat, "r")
ListBox1.List(s, 15) = Sheets("Database").Cells(sat, "s")
ListBox1.List(s, 15) = Sheets("Database").Cells(sat, "t")
ListBox1.List(s, 16) = Sheets("Database").Cells(sat, "k")
s = s + 1
Next
End Sub

arkadaşlar bu kod runtime hatası veriyor çözemedim bir türlü yardımcı olabilirmisiniz.
 

Ekli dosyalar

Kod:
Private Sub UserForm_Initialize()
Dim satir As Integer
satir = 1
ReDim myarr(1 To [b65536].End(3).Row - 1, 1 To 11)
For X = 2 To [b65536].End(3).Row
    myarr(satir, 1) = Range("b" & X)
     myarr(satir, 2) = Range("c" & X)
     myarr(satir, 3) = Range("d" & X)
     myarr(satir, 4) = Range("e" & X)
     myarr(satir, 5) = Range("f" & X)
     myarr(satir, 6) = Range("g" & X)
     myarr(satir, 7) = Range("h" & X)
     myarr(satir, 8) = Range("i" & X)
     myarr(satir, 9) = Range("j" & X)
     myarr(satir, 10) = Range("l" & X) - Range("K" & X)
     myarr(satir, 11) = Range("m" & X)
     myarr(satir, 11) = Range("n" & X)
     myarr(satir, 11) = Range("o" & X)
     myarr(satir, 11) = Range("p" & X)
     myarr(satir, 11) = Range("q" & X)
     myarr(satir, 11) = Range("r" & X)
     myarr(satir, 11) = Range("s" & X)
     myarr(satir, 11) = Range("t" & X)
     myarr(satir, 11) = Range("k" & X)
    satir = satir + 1
Next
ListBox1.List = myarr
End Sub

bu şekilde çalışıyor fakat linklerdeki bilgilerde listbox taki bilgiyi aktarma yok.

Kod:
Private Sub ListBox1_Click()
TextBox1 = ListBox1.Column(0)
TextBox2 = ListBox1.Column(1)
TextBox3 = ListBox1.Column(2)
TextBox4 = ListBox1.Column(3)
TextBox5 = ListBox1.Column(4)
TextBox6 = ListBox1.Column(5)
TextBox7 = ListBox1.Column(6)
TextBox8 = ListBox1.Column(7)
TextBox9 = ListBox1.Column(8)
TextBox10 = ListBox1.Column(9)
Label58.Caption = ListBox1.Column(10)
Label59.Caption = ListBox1.Column(11)
Label60.Caption = ListBox1.Column(12)
TextBox11 = ListBox1.Column(13)
TextBox12 = ListBox1.Column(14)
TextBox13 = ListBox1.Column(15)
TextBox14 = ListBox1.Column(16)
TextBox15 = ListBox1.Column(17)
TextBox16 = ListBox1.Column(18)
End Sub

bu kod hata veriyor bunu çözemedim
 
Birinci koddaki ilgili satırı aşağıdaki ile değiştirin.
Kod:
ReDim myarr(1 To [b65536].End(3).Row - 1, 1 To 19)
 
Geri
Üst