
Function ColorFont(数据区域 As Range, 目标单元格 As Range, Optional 颜色序号 As Integer = 3)
Dim d, n, Arr, i
Arr = 数据区域
Set d = CreateObject("scripting.dictionary")
For Each n In Arr
d(n) = ""
Next n
For i = 1 To Len(目标单元格)
If d.exists(Mid(目标单元格, i, 1)) Then
目标单元格.Characters(i, 1).Font.ColorIndex = 颜色序号
End If
Next i
ColorFont = ""
End Function
有点不伦不类,见笑。