فایل پیوست را بررسی بفرمایید
کد PHP:
Private Sub CommandButton1_Click()
Z1 = Sheet2.Cells(Sheet2.Rows.Count, "A").End(xlUp).Row + 1
Z2 = Sheet2.Cells(Sheet2.Rows.Count, "B").End(xlUp).Row + 1
If Z1 = 1 Then Z1 = 2
If Z2 = 1 Then Z2 = 2
If Z1 > Z2 Then
Z = Z1
Else
Z = Z2
End If
Sheet2.Range("A" & Z) = TextBox1.Value
Sheet2.Range("B" & Z) = TextBox2.Value
TextBox1.Value = ""
TextBox2.Value = ""
End Sub
Leave a comment: