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

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

  • أفضل إجابة
قام بنشر

بعد اذن الاخ عبدالله هذا الكود


 Sub test_please()
 Range("A1").CurrentRegion.Offset(, 1).ClearContents
 i = 1
  Do Until Range("A" & i) = vbNullString
  Call SPLIT_ME _
  (Range("a" & i), "(\D)(\d{4})[0]+(\d{3})(\d{3})", i, 2)
   i = i + 1
   Loop
 End Sub
 '+++++++++++++++++++++++++++++++

Sub SPLIT_ME(c As Range, pttrn As String, ByVal k%, m%)

With CreateObject("VBscript.RegExp")
    .Global = True
    .MultiLine = True
    .IgnoreCase = False
    .Pattern = pttrn
     If Not .Test(c.Value) Then Exit Sub
        Set Results = .Execute(c.Value)
             For i = 0 To Results(0).Submatches.Count - 1
                Cells(k, m) = Results(0).Submatches(i)
                m = m + 1
             Next
End With
End Sub

الملف مرفق

 

Split_cells.xlsm

  • Like 5
  • 4 weeks later...

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