وهذا إختصار للكود (تم تعديل تسلسل خانة الاختيار الخاصة بالاكسسوارات لتحمل الرقم 7 و 8 و 9)
Private Sub CommandButton1_Click()
LastRow = Cells(Rows.Count, "a").End(xlUp).Row + 1
Cells(LastRow, 1) = ComboBox1.Value
Cells(LastRow, 2) = TextBox1.Value
Cells(LastRow, 3) = TextBox2.Value
For i = 1 To 9
If Me.Controls("CheckBox" & i) Then
If i > 6 Then
Cells(LastRow, 5) = Cells(LastRow, 5) & R & Me.Controls("CheckBox" & i).Caption
R = " + "
Else
Cells(LastRow, 4) = Cells(LastRow, 4) & T & Me.Controls("CheckBox" & i).Caption
T = " + "
End If
End If
Next
Unload Me
End Sub
New folder (3).zip