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

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

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

بعد اذن الاخ علي

هذا الكود

Option Explicit
Sub Extract_by_Groupes()
Rem         Created By Salim Hasbaya On 19/2/2020
If ActiveSheet.Name <> "ورقة1" Then Exit Sub
Application.Calculation = xlCalculationManual
Dim ObjReg As Object
Dim ObjMatches, a%, My_word, i%
Dim k%, col%, last_row
last_row = Cells(Rows.Count, 1).End(3).Row
Range("E6:G" & last_row).Clear
Set ObjReg = CreateObject("VBScript.RegExp")
With ObjReg
.Pattern = "(\W+)(\d+)[%-:,_](\W+)"
.Global = True
End With
For k = 6 To last_row
 If ObjReg.test(Range("a" & k)) Then
Set ObjMatches = ObjReg.Execute(Range("a" & k))
 For Each My_word In ObjMatches             'The variable match will contain the full match
    a = My_word.Submatches.Count           'total number of groups in the full match
    col = 5
    For i = 0 To a - 1
     Cells(k, col) = My_word.Submatches(i)
     col = col + 1
    Next
Next
End If
col = 5
Next
    With Range("E6:G" & last_row)
    .Borders.LineStyle = 1
    .Font.Size = 14
    .Font.Bold = True
    .InsertIndent 1
    .Columns.AutoFit
    .Interior.ColorIndex = 40
    End With
Set ObjReg = Nothing
Application.Calculation = xlCalculationAutomatic
End Sub

الملف مرفق

 

Extract Number.xlsm

  • Like 1
  • Thanks 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