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

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

قام بنشر

 رداً على سؤال حارثة ابو زيد 

يلزم وقتها هذا الكود

Option Explicit
'==============================
Sub colorize_ALL()
Dim x%, k%, i%, m%
Dim MY_St1$, MY_St2$, find_txt$
Dim My_Txt
Dim Last_Row%: Last_Row = Cells(Rows.Count, 1).End(3).Row
If Last_Row < 2 Then Last_Row = 2
MY_St2 = UCase(Range("c2"))
Application.ScreenUpdating = False
For i = 2 To Last_Row
      MY_St1$ = UCase(Range("a" & i).Value)
            With Range("a" & i).Font
            .ColorIndex = 0: .Underline = False:
            .Italic = False: .Bold = False
            End With
    '==================================
       For m = 1 To Len(MY_St1) - Len(MY_St2) + 1
        find_txt$ = Mid(MY_St1, m, Len(MY_St2))
         If find_txt$ = MY_St2 Then
              With Range("a" & i).Characters(m, Len(MY_St2)).Font
              .ColorIndex = 3: .Underline = True:
              .Italic = True: .Bold = True
               k = k + 1
              End With
         End If
       Next m
    i = i + Range("a" & i).MergeArea.Rows.Count - 1
Next i
  Select Case k
  Case 0: Range("b2") = "Nothing similar"
  Case Else: Range("b2") = "There are: " & Chr(10) & k & "  Expressions"
  End Select
  If k = 1 Then Range("b2") = Mid(Range("b2"), 1, Len(Range("b2")) - 1)
Exite_Me:
  Application.ScreenUpdating = True
End Sub


الملف مرفق (مغ بعض الشرح في الورقة Sheet1)

Full_Saerch_expressions.xlsm

  • Like 3
  • 4 weeks later...
قام بنشر (معدل)

جميل جداااا سلمت يداك استاذى العزيز 

تم تعديل بواسطه Mina AboElSaad

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