|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Option Explicit
Sub TEST6()
Dim ar, i&, j&, k&, r&, dic As Object
Application.ScreenUpdating = False
Set dic = CreateObject("Scripting.Dictionary")
With Range("A1", ActiveSheet.UsedRange)
ar = .Value
.Offset(1).Clear: r = 1
For i = 2 To UBound(ar)
dic.RemoveAll
For j = 2 To UBound(ar, 2)
If Len(ar(i, j)) Then dic(ar(i, j)) = Empty
Next j
If dic.Count > 1 Then
r = r + 1
For j = 1 To UBound(ar, 2)
.Cells(r, j) = ar(i, j)
With .Cells(r, 1)
For k = 1 To Len(.Value)
If dic.exists(Mid(.Value, k, 1)) Then
.Characters(Start:=k, Length:=1).Font.Color = vbRed
End If
Next k
End With
Next j
End If
Next i
End With
Set dic = Nothing
Application.ScreenUpdating = True
Beep
End Sub |
评分
-
1
查看全部评分
-
|