|
Sub test()
Set d = CreateObject("scripting.dictionary")
With Sheet1
.Range("a1").CurrentRegion.Font.ColorIndex = 0
ar = .Range("a1").CurrentRegion
For i = 1 To UBound(ar)
s = ar(i, 1)
s = Replace(s, ",", "-")
s = Replace(s, "~", "-")
t = Split(s, "-")
For x = 0 To UBound(t)
If Not d.exists(t(x)) Then
d(t(x)) = Array(i, InStr(s, t(x)), Len(t(x)))
Else
a = d(t(x))
.Cells(a(0), 1).Characters(a(1), a(2)).Font.ColorIndex = 3
st = InStr(s, t(x))
.Cells(i, 1).Characters(st, a(2)).Font.ColorIndex = 3
End If
Next
Next
End With
Set d = Nothing
End Sub
|
|