|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
'修改19楼代码。条件一样:A、B、C列有序,[a3]开始
Option Explicit
Sub test()
Dim i As Long, j As Long, k As Long, n As Long, arr, dt
Application.ScreenUpdating = False
dt = Timer
arr = Range("a3:c" & Cells(Rows.Count, "a").End(xlUp).Row + 1)
ReDim brr(1 To UBound(arr, 1), 1 To 1) As String
For i = 1 To UBound(arr, 1) - 1
For j = i To UBound(arr, 1) - 1
If arr(j, 1) & arr(j, 2) & arr(j, 3) <> arr(j + 1, 1) & arr(j + 1, 2) & arr(j + 1, 3) Then
If j > i Then
n = 0
For k = i To j
brr(k, 1) = "重复" & n: n = n + 1
Next
Else
brr(j, 1) = "唯一"
End If
i = j: Exit For
End If
Next j, i
[d3].Resize(UBound(brr, 1)) = brr
Debug.Print Timer - dt
Application.ScreenUpdating = True
End Sub |
评分
-
1
查看全部评分
-
|