سيكون الكود كالتالى
Private Sub CommandButton1_Click()
Dim krow As Long
'Dim ws As Worksheet
'Set ws = Worksheets("ß2")
krow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With ActiveSheet
.Cells(krow, 5).Value = Me.TextBox1.Value
.Cells(krow, 7).Value = Me.TextBox2.Value
.Cells(krow, 8).Value = Me.TextBox3.Value
.Cells(krow, 9).Value = Me.TextBox4.Value
.Cells(krow, 10).Value = Me.TextBox5.Value
.Cells(krow, 11).Value = Me.TextBox6.Value
.Cells(krow, 12).Value = Me.TextBox7.Value
.Cells(krow, 13).Value = Me.TextBox8.Value
.Cells(krow, 14).Value = Me.TextBox9.Value
.Cells(krow, 15).Value = Me.TextBox10.Value
.Cells(krow, 19).Value = Me.TextBox11.Value
.Cells(krow, 20).Value = Me.TextBox12.Value
.Cells(krow, 21).Value = Me.TextBox13.Value
.Cells(krow, 22).Value = Me.TextBox14.Value
.Cells(krow, 23).Value = Me.TextBox15.Value
.Cells(krow, 24).Value = Me.TextBox16.Value
.Cells(krow, 25).Value = Me.TextBox17.Value
.Cells(krow, 26).Value = Me.TextBox18.Value
.Cells(krow, 27).Value = Me.TextBox19.Value
'ws.Cells(krow, 25).Value = Me.TextBox7.Value
'ws.Cells(krow, 26).Value = Me.TextBox7.Value
'ws.Cells(krow, 27).Value = Me.TextBox7.Value
Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
Me.TextBox3.Value = ""
Me.TextBox4.Value = ""
Me.TextBox5.Value = ""
Me.TextBox6.Value = ""
Me.TextBox7.Value = ""
Me.TextBox8.Value = ""
Me.TextBox9.Value = ""
Me.TextBox10.Value = ""
Me.TextBox11.Value = ""
Me.TextBox12.Value = ""
Me.TextBox13.Value = ""
Me.TextBox14.Value = ""
Me.TextBox15.Value = ""
Me.TextBox16.Value = ""
Me.TextBox17.Value = ""
Me.TextBox18.Value = ""
Me.TextBox19.Value = ""
'Me.TextBox20.Value = ""
'Me.TextBox21.Value = ""
'Me.TextBox22.Value = ""
Me.TextBox1.SetFocus
End With
End Sub
المرفقات
ارساليات ومدفوعات 2011- kemas.rar