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

المساعدة في استخراج الاسماء المتشابهة في الاسم والأول والثاني والثالث


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

حرب هذا الماكرو

الاسماء في العامود A ابتداء من الخلية 2

Option Explicit
Sub extract()
Dim i%: i = 2
Dim x%, k%, t%
Dim m%: m = 1
Dim arr1, arr2, arr3()
Dim my_arr
Range("c:c").ClearContents
Do Until Range("a" & i) = vbNullString
arr1 = Split(Trim(Range("a" & i)), " ")
 If UBound(arr1) < 3 Then GoTo 1:
 For x = i + 1 To 6
  arr2 = Split(Trim(Range("a" & x)), " ")
  If UBound(arr2) < 3 Then GoTo 1:
  For k = 0 To 2
   If arr1(k) = arr2(k) Then
    ReDim Preserve arr3(t)
    arr3(t) = arr2(k)
    t = t + 1
    End If
   Next
  my_arr = Join(arr3, " ")
  If my_arr <> "" Then
    Range("c" & m) = my_arr
    my_arr = ""
 End If
 Erase arr3
  t = 0
1:
Next
i = i + 1
m = m + 1
Loop
End Sub

الملف مرفق

 

Booksalim.xls

  • Like 1
رابط هذا التعليق
شارك

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