اخى خالد
جرب تغير الكود
الاتى
Private Sub CommandButton1_Click()
If t1 = "" Then
MsgBox "íÌÈ Úáíß ÇÏÎÇá ÑÞã"
t1.SetFocus
Else
On Error Resume Next
If Application.VLookup(t1, Range("A:a"), 1, 0) = Error Then
lr = Range("a" & Rows.Count).End(xlUp).Row + 1
Cells(lr, 1) = t1
Cells(lr, 2) = t2
Cells(lr, 3) = t3
t1 = ""
t2 = ""
t3 = ""
t1.SetFocus
Else
MsgBox "åÐÇ ÇáÑÞã ãæÌæÏ ãä ÞÈá", vbOKOnly, "ÊäÈíå"
t1 = ""
t1.SetFocus
End If
End If
End Sub
الى الكود الاتى
Private Sub CommandButton1_Click()
If t1 = "" Then
MsgBox "íÌÈ Úáíß ÇÏÎÇá ÑÞã"
t1.SetFocus
Else
On Error Resume Next
If Application.VLookup(t1, Range("A:a"), 1, 0) = Error Then
lr = Range("a" & Rows.Count).End(xlUp).Row + 1
Cells(lr, 1) = t1.Value
Cells(lr, 2) = t2.Text
Cells(lr, 3) = t3.Text
t1 = ""
t2 = ""
t3 = ""
t1.SetFocus
Else
MsgBox "åÐÇ ÇáÑÞã ãæÌæÏ ãä ÞÈá", vbOKOnly, "ÊäÈíå"
t1 = ""
t1.SetFocus
End If
End If
End Sub
تقبل تحياتى