Consulting

Results 1 to 2 of 2

Thread: Find and color text with Text List

  1. #1

    Lightbulb Find and color text with Text List

    Hi all,

    i'm seeking to find a macro way that can go through excel file with many segments with name for ex. (Project) then color all words inside all cells according to another excel file defined previously for ex. (keywords)

    for ex

    Project file contains cells as following:

    1- Check out the examples of abstract nouns
    2- Active voice describes a sentence where the subject
    3- Comparative adjectives are used to compare


    keywords file contains words as following:

    abstract nouns
    subject
    Comparative adjectives
    ......etc


    so i want to color only words (abstract nouns, subject, Comparative adjectives) from Project file

    0.jpg


    Thanks i advance for helping



    Cross-Posting: https://www.excelforum.com/excel-pro...ml#post4870362
    Last edited by Ethen5155; 03-24-2018 at 09:44 AM.

  2. #2
    Solved:

    by tim201110 :


    Sub kewd()
    Dim lr&, i&, j&
    ka = Application.Transpose(Range("_k"))
    lr = Cells(Rows.Count, 1).End(xlUp).Row
    For i = 1 To lr
    For j = 1 To UBound(ka)
    If InStr(StrConv(Cells(i, 1), vbLowerCase), ka(j)) > 0 Then
    Cells(i, 1).Characters(Start:=InStr(StrConv(Cells(i, 1), vbLowerCase), ka(j)), Length:=Len(ka(j))).Font.Color = -16776961
    End If
    Next j
    Next i
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •