|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
代码挺好用的
Option Explicit
Sub 字典法专业去重复()
Dim dic, arr, x%, n%
Set dic = CreateObject("scripting.dictionary")
With Sheets(2)
arr = Sheets(1).Range("a1").CurrentRegion
For x = 2 To UBound(arr)
If arr(x, 2) = .[c3].Text Then
If Not dic.Exists(arr(x, 2)) Then: dic(arr(x, 3)) = ""
End If
Next
.Range("a16:a" & Cells(Rows.Count, 1).End(xlUp).Row).ClearContents
.[a16].Resize(dic.Count) = Application.Transpose(dic.keys)
Set dic = Nothing
End With
End Sub
|
评分
-
1
查看全部评分
-
|