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

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

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

حرب هذا الملف

Option Explicit

Sub Get_Color()
Dim My_Regex        As Object
Dim x%, m%, La%, t%
Dim arrWords, Arr()
ReDim Arr(4)
 Arr(0) = 3: Arr(1) = 14: Arr(2) = 5: Arr(3) = 3
 Set My_Regex = CreateObject("VBScript.RegExp")
 My_Regex.Pattern = "(\d{3})"
 My_Regex.Global = True
 With Sheets("Sheet1")
     La = .Cells(Rows.Count, 3).End(3).Row
     m = 1
        With .Range("E6:E" & La)
         .Font.ColorIndex = 1
         .ClearContents
        End With
    For t = 6 To La
        .Range("E" & t) = .Range("C" & t)
          If My_Regex.test(.Range("E" & t)) Then
            Set arrWords = My_Regex.Execute(.Range("E" & t))
              For x = 0 To arrWords.Count - 1
                 Range("E" & t).Characters(m, 3) _
                 .Font.ColorIndex = Arr(x)
               m = m + 3
              Next x
          End If
        m = 1
    Next t
   End With
End Sub

الملف مرفق

Abbadi.xlsm

  • Like 5
  • 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