اضافة بيانات من تكست بوكس الى ليست بوكس والترحيل من ليست بوكس الى شيت معين
بأكثر من طريقة
طريقة بسيطة للتوضيح
وطريقة بالحلقات التكرارية

الكود المستخدم
CODE
Private Sub CommandButton1_Click()
With Sheets("sheet1")
Z = 3
For v = 0 To ListBox1.ListCount - 1
.Cells(Z, 1).Value = ListBox1.List(v, 0)
.Cells(Z, 2).Value = ListBox1.List(v, 1)
.Cells(Z, 3).Value = ListBox1.List(v, 2)
.Cells(Z, 4).Value = ListBox1.List(v, 3)
.Cells(Z, 5).Value = ListBox1.List(v, 4)
.Cells(Z, 6).Value = ListBox1.List(v, 5)
.Cells(Z, 7).Value = ListBox1.List(v, 6)
.Cells(Z, 8).Value = ListBox1.List(v, 7)
.Cells(Z, 9).Value = ListBox1.List(v, 8)
Z = Z + 1
Next
End With
End Sub
Private Sub CommandButton2_Click()
v = ListBox1.ListCount
ListBox1.AddItem
ListBox1.List(v, 0) = TextBox1.Text
ListBox1.List(v, 1) = TextBox2.Text
ListBox1.List(v, 2) = TextBox3.Text
ListBox1.List(v, 3) = TextBox4.Text
ListBox1.List(v, 4) = TextBox5.Text
ListBox1.List(v, 5) = TextBox6.Text
ListBox1.List(v, 6) = TextBox7.Text
ListBox1.List(v, 7) = TextBox8.Text
ListBox1.List(v, 8) = TextBox9.Text
End Sub
Private Sub CommandButton3_Click()
ii = 1
v = ListBox1.ListCount
ListBox1.AddItem
For i = 0 To Me.ListBox1.ColumnCount - 1
Me.ListBox1.List(v, i) = Me.Controls("TextBox" & ii).Value
ii = ii + 1
Next
End Sub
Private Sub CommandButton4_Click()
With Sheets("sheet1")
Z = 3
For v = 0 To ListBox1.ListCount - 1
For x = 0 To 8
.Cells(Z, x + 1).Value = ListBox1.List(v, x)
Next x
Z = Z + 1
Next v
End With
End Sub
VBA
listbox.rar
تحياتي