Private Sub CommandButton1_Click()
Dim dcc As Long
Dim abc As Worksheet
Set abc = Worksheets("m1")
dcc = Sheets("m1").Range("A" & Rows.Count).End(xlUp).Row
With abc
.Cells(dcc + 1, 1).Value = Me.TextBox1.Text
.Cells(dcc + 1, 2).Value = Me.TextBox2.Text
.Cells(dcc + 1, 3).Value = Me.TextBox3.Text
.Cells(dcc + 1, 4).Value = Me.TextBox4.Text
Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
Me.TextBox3.Value = ""
Me.TextBox4.Value = ""
MsgBox ("تم الاضافة بابطل")
End With
End Sub
Private Sub CommandButton2_Click()
Dim totrows As Long, i As Long
totrows = Sheets("m1").Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To totrows
If Trim(m1.Cells(i, 1)) = Trim(TextBox1.Text) Then
TextBox1.Text = m1.Cells(i, 1)
TextBox2.Text = m1.Cells(i, 2)
TextBox3.Text = m1.Cells(i, 3)
TextBox4.Text = m1.Cells(i, 4)
Exit For
End If
Next i
End Sub
Private Sub Label1_Click()
End Sub
Private Sub Label4_Click()
End Sub