اذهب الي المحتوي
أوفيسنا

الردود الموصى بها

قام بنشر

لقد قمت بعمل نوذج للبح مع التديع

يكون البحث بالاسم فى العمود d

ولكن عند استحدام الامر تعديل يقوم بنسخ الاسم فى العمود a

هل يمكن تفادى ذلك

حيث ان العمود على رقم العميل

واليكم الكود المستخدم

Private Sub CommandButton2_Click()

Dim iRow As Long

Dim ws As Worksheet

Set ws = Worksheets("ÈíÇäÇÊ ÇáÚãáÇÁ")

'ááÚËæÑ Úáì Ãæá ÓØÑ ÝÇÑÛ Ýí ÞÇÚÏÉ ÇáÈíÇäÇÊ "ÕÝÍÉ ÈíÇäÇÊ ÇáãæÑÏíä

iRow = ws.Cells(Rows.Count, 1) _

.End(xlUp).Offset(1, 0).Row

'ááÊÃßÏ ãä ÅÏÎÇá ßæÏ

If Trim(Me.TextBox1.Value) = "" Then

Me.TextBox1.SetFocus

MsgBox ("ãä ÝÖáß .Þã ÈÅÏÎÇá ßæÏ")

Exit Sub

End If

'ÊÑÍíá ÇáÈíÇäÊ Åáì ÕÝÍÉ ÈíÇäÇÊ ÇáãæÑÏíä

ws.Cells(iRow, 1).Value = Me.TextBox1.Value

ws.Cells(iRow, 2).Value = Me.TextBox2.Value

ws.Cells(iRow, 3).Value = Me.TextBox3.Value

ws.Cells(iRow, 4).Value = Me.TextBox4.Value

ws.Cells(iRow, 5).Value = Me.TextBox5.Value

ws.Cells(iRow, 6).Value = Me.TextBox6.Value

ws.Cells(iRow, 7).Value = Me.TextBox7.Value

ws.Cells(iRow, 9).Value = Me.TextBox8.Value

ws.Cells(iRow, 10).Value = Me.TextBox9.Value

ws.Cells(iRow, 12).Value = Me.TextBox10.Value

ws.Cells(iRow, 13).Value = Me.TextBox11.Value

ws.Cells(iRow, 15).Value = Me.TextBox12.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.TextBox1.SetFocus

End Sub

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • اضف...

Important Information