|
本帖最后由 kenask 于 2014-5-24 19:55 编辑
- Sub test()
- Dim d As Object, arr, x As Long, y As Long, n As Long, z As Byte, str, icell As Range, nrow As Long
- Application.ScreenUpdating = False
- For x = 2 To Sheets.Count
- nrow = Sheets(x).Range("a65536").End(xlUp).Row
- arr = Sheets(x).Range("a1:a" & nrow)
- Set d = CreateObject("scripting.dictionary")
- For y = 1 To UBound(arr)
- d(arr(y, 1)) = ""
- Next y
- n = Range("f65536").End(xlUp).Row
- For y = 5 To n
- Set icell = Cells(y, "f")
- str = Split(icell, ",")
- For z = 0 To UBound(str)
- If d.exists(str(z)) Then
- icell.Characters(Start:=InStr(icell.Value, str(z)), Length:=Len(str(z))).Font.Color = Choose(x - 1, -16776961, -11489280)
- End If
- Next z
- Next y
- Next x
- Application.ScreenUpdating = True
- End Sub
复制代码
查找相同的字符串标颜色.rar
(38.37 KB, 下载次数: 103)
试着写了一下。。。。。 |
|