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

تعديل في كود البحث TextBox


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

السلام عليكم 

برجاء المساعده عن استخدام كود البحث في Textbox  بالارقام  مثلا (800) اما اذا كان (800B) لا يقبل 

 فبرجاء المساعده في تعديل الكود 

()Private Sub TextBox4_Change
X = WorksheetFunction.CountIf(Sheet8.Range("a:a"), Val(Me.TextBox4.Value))
 Set ws = Application.WorksheetFunction
With Me
If .TextBox4.Value <> "" And X <> 0 Then
.TextBox5 = Application.WorksheetFunction.VLookup(CLng(Me.TextBox4.Value), Sheet8.Range("a1:d10000"), 3, 0)
.TextBox6 = Application.WorksheetFunction.VLookup(CLng(Me.TextBox4.Value), Sheet8.Range("a1:d10000"), 4, 0)
Else
.TextBox5 = ""
.TextBox6 = ""

End If
End With

End Sub

 

 

1.JPG

2.JPG

Test 1.xlsm

تم تعديل بواسطه checles
رابط هذا التعليق
شارك

Private Sub TextBox4_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
    If (KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 46 Then
    Else
        KeyAscii = 0
        MsgBox "يجب ادخال ارقام فقط", vbCritical
    End If
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.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information