0
我一直在使用下面,但發現它只突出顯示/更改每個單元格的第一個子字符串的字體顏色。我如何確保它也突出顯示後續的內容?如何突出顯示單元格中特定子字符串的所有出現次數?
Sub test4String2color()
Dim strTest As String
Dim strLen As Integer
strTest = Range("F1")
strLen = Len(strTest)
For Each cell In Range("A1:D100")
If InStr(cell, strTest) > 0 Then
cell.Characters(InStr(cell, strTest), strLen).Font.Color = vbRed
End If
Next
End Sub