|
Sub 按钮1_Click()
Application.ScreenUpdating = False
Dim rng1 As Range
Dim rng2 As Range
Set d = CreateObject("scripting.dictionary")
arr = Sheets("枚举选项").UsedRange
For j = 2 To UBound(arr)
d(arr(j, 1)) = ""
Next j
arr = [a1].CurrentRegion
For j = 2 To UBound(arr)
If Not d.exists(arr(j, 1)) Then
If rng1 Is Nothing Then
Set rng1 = Cells(j, 1)
Else
Set rng1 = Union(rng1, Cells(j, 1))
End If
End If
If Len(arr(j, 2)) > 4 Then
If rng2 Is Nothing Then
Set rng2 = Cells(j, 2)
Else
Set rng2 = Union(rng2, Cells(j, 2))
End If
End If
Next j
If Not rng1 Is Nothing Then rng1.Interior.ColorIndex = 6
If Not rng2 Is Nothing Then rng2.Interior.ColorIndex = 8
Application.ScreenUpdating = True
End Sub
|
|