|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
代码如下。。。。
Sub test()
Dim wb As Workbook, sht As Worksheet
Set wb = ThisWorkbook
Set sht = wb.Sheets("sheet1")
s = Split("火 中")
Set d = CreateObject("scripting.dictionary")
For i = 0 To UBound(s)
ss = s(i)
If ss <> Empty Then
If Not d.exists(ss) Then
n = n + 1
d(ss) = n
End If
End If
Next
With sht
r = .Cells(Rows.Count, 3).End(3).Row
arr = .Range("c1:c" & r)
.Range("c1:c" & r).Font.ColorIndex = 1
For i = 1 To UBound(arr)
sss = arr(i, 1)
If sss <> Empty Then
For j = 1 To Len(sss)
If d.exists(Mid(sss, j, 1)) Then
.Cells(i, 3).Characters(j, 1).Font.ColorIndex = 3
End If
Next
End If
Next
End With
Beep
Set d = Nothing
End Sub
|
评分
-
1
查看全部评分
-
|