|
参与一下。。。- Sub ykcbf() '//2024.1.28
- Dim arr, brr, d
- Set d = CreateObject("Scripting.Dictionary")
- Set d1 = CreateObject("Scripting.Dictionary")
- Application.ScreenUpdating = False
- r = Me.Cells(Rows.Count, 6).End(xlUp).Row
- arr = Me.[f1].Resize(r, 1)
- For i = 2 To UBound(arr)
- s = arr(i, 1)
- d(s) = ""
- Next
- t = d.items
- r = Me.Cells(Rows.Count, 1).End(xlUp).Row
- Me.Columns(2).Font.ColorIndex = 0
- For i = 2 To r
- s = Me.Cells(i, 1)
- If d.exists(s) Then
- d1(s) = d1(s) + 1
- If d1(s) > 1 Then
- Me.Cells(i, 2) = "重复有"
- Me.Cells(i, 2).Font.ColorIndex = 3
- Else
- Me.Cells(i, 2) = "比对OK"
- End If
- End If
- Next
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|