|
你这两个问题是不是有点相互矛盾,1->是删除重复;2->标记重复。执行了1,2怎么执行呢?
- 'http://club.excelhome.net/thread-1438311-1-1.html
- Sub Check_Duplicated()
- Dim Dic As Object
- Dim arr
- Dim Sk$
- Dim m
- Set Dic = CreateObject("Scripting.Dictionary")
- With Sheet1
- 'B列读入字典
- For m = 3 To .Cells(65536, 2).End(xlUp).Row
- Sk = .Cells(m, 2).Value
- If Not Dic.Exists(Sk) Then Dic(Sk) = Dic(Sk) + 1
- Next m
- '检查A列值
- For m = 3 To .Cells(65536, 1).End(xlUp).Row
- Sk = .Cells(m, 1).Value
- If Dic.Exists(Sk) Then
- .Cells(m, 1) = ""
- .Cells(m, 1).Interior.ColorIndex = 44
- End If
- Next m
- End With
- Debug.Print Timer
- End Sub
复制代码 |
|