|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 看见星光 于 2016-2-15 09:22 编辑
- Sub dd()
- Dim d As Object, arr, brr, i&, j&, k
- Set d = CreateObject("scripting.dictionary")
- arr = Range("e1:e" & [a1].CurrentRegion.Rows.Count)
- For i = 2 To UBound(arr)
- d(arr(i, 1)) = d(arr(i, 1)) & "," & i
- Next
- ReDim brr(2 To UBound(arr), 1 To 1)
- For i = 2 To UBound(arr)
- k = Mid(Replace(d(arr(i, 1)), "," & i, ""), 2)
- If Len(k) Then brr(i, 1) = "与第" & k & "行重复"
- Next
- [h2].Resize(UBound(arr) - 1, 1) = brr
- Set d = Nothing
- End Sub
复制代码
|
|