Listbox'a veri eklemek

musculus2

Altın Üye
Altın Üye
Katılım
23 Şubat 2007
Mesajlar
112
Excel Vers. ve Dili
2013 türkçe
Altın Üyelik Bitiş Tarihi
09-06-2027
Her CommandButton a tıklayarak textbox1 deki veriyi Listbox1 e aktarmaya çalışıyorum ama Listbox1 de hep 1.satıra veriyi yazıyor ikinci satıra geçemedim.

Private Sub CommandButton1_Click()

Workbooks("HPV KİT TAKİP").Sheets("barkod").Select
Set s2 = Workbooks("HPV KİT TAKİP").Sheets("barkod")
son = [h65535].End(3).Row
If IsNumeric(TextBox1) Then GoTo 20
MsgBox ("Lütfen sayısal barkod giriniz"), , "veri hatası"

TextBox1 = ""
Cancel = True
TextBox1.SetFocus
Exit Sub
20
'aynı rakamı eklemediğini kontrol etmeyi unutma
ListBox1.AddItem
ListBox1.List(s, 0) = ComboBox1.Value
ListBox1.List(s, 1) = TextBox1.Value
s = s + 1
MsgBox s
s2.Range("h" & son + 1).Value = TextBox1.Value
TextBox1.Value = ""
TextBox1.SetFocus
End Sub
 

Ekli dosyalar

musculus2

Altın Üye
Altın Üye
Katılım
23 Şubat 2007
Mesajlar
112
Excel Vers. ve Dili
2013 türkçe
Altın Üyelik Bitiş Tarihi
09-06-2027
s = s2.Range("ı4").Value
ListBox1.AddItem
ListBox1.List(s, 0) = ComboBox1.Value
ListBox1.List(s, 1) = TextBox1.Value

s2.Range("g" & son + 1).Value = ComboBox1.Value
s2.Range("h" & son + 1).Value = TextBox1.Value
TextBox1.Value = ""
TextBox1.SetFocus
s2.Range("ı4").Value = s2.Range("ı4").Value + 1
s = s2.Range("ı4").Value

şeklinde çözdüm :)
 
Üst