اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

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

قام بنشر

السلام عليكم ورحمة الله وبركاته

 

اخواني الأعزاء اريد مساعدة في هذا الكود لجعله يبحث عن أي حرف لو في منتصف ا لخلية 

 

Quote

Private Sub TextBox1_Change()
On Error Resume Next
Label1.Visible = True
Label2.Visible = True
Label3.Visible = True
Label4.Visible = True
Label5.Visible = True
Label6.Visible = True
ListBox1.Visible = True
Dim WS As Worksheet
Dim V As Integer
Dim LastRow As Integer
Dim M As String
Dim Q, F
ListBox1.Clear
If TextBox1.Text = "" Then GoTo 1
M = TextBox1.Text
Set WS = Sheets("ورقة1")
With WS
 LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
Set Q = .Range("B2:B" & LastRow).Find(M)
If Not Q Is Nothing Then
F = Q.Address
Do
If Application.WorksheetFunction.Search(M, Q, 1) = 1 Then
ListBox1.AddItem Q.Value
ListBox1.List(V, 0) = Q.Offset(0, 3).Value
ListBox1.List(V, 1) = Q.Offset(0, 2).Value
ListBox1.List(V, 2) = Q.Offset(0, 1).Value
ListBox1.List(V, 3) = Q.Offset(0, 0).Value
ListBox1.List(V, 4) = Q.Offset(0, -1).Value
 V = V + 1
TextBox2.Value = ListBox1.ListCount
 End If
Set Q = .Range("B2:B" & LastRow).FindNext(Q)
 Loop While Not Q Is Nothing And Q.Address <> F
 End If
End With
1 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