申し訳ありませんが、今はこれを完了する時間がありませんが、wこのようなものは役に立ちますかおそらく最初の列の各セルのループ?
編集: B5 と Z5 に更新する 2 番目の編集、列参照を使用して 3 つの固定グーフを編集し、変数を使用して検索する列を割り当てるように更新しました。
Sub colortext()
start_row = 5
key_col = 2
linked_col = 26
i = start_row 'start on row one
Do While Not IsEmpty(Cells(i, key_col)) 'Do until empty cell
o = start_row 'start with row one for second column
Do While Not IsEmpty(Cells(o, linked_col)) 'Do until empty cell
If Not InStr(1, Cells(o, linked_col), Cells(i, key_col)) = 0 Then 'if cell contents found in cell
With Cells(o, linked_col).Characters(Start:=InStr(1, Cells(o, linked_col), Cells(i, key_col)), Length:=Len(Cells(i, key_col))).Font
.Color = Cells(i, key_col).Font.Color 'change color of this part of the cell
End With
End If
o = o + 1 'increment the cell in second column
Loop
i = i + 1 'increment the cell in the first column
Loop
End Sub
または多分
このようなもの?
Excel VBA:セル範囲内の特定の文字のフォントの色を変更する