|
- Sub test()
- Dim r&, i&
- Dim arr, brr
- Dim d As Object
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- Set d = CreateObject("scripting.dictionary")
- With Worksheets("RawData")
- .AutoFilterMode = False
- r = .Cells(.Rows.Count, 2).End(xlUp).Row
- arr = .Range("b2:b" & r)
- ReDim brr(1 To UBound(arr), 1 To 1)
- For i = 1 To UBound(arr)
- d(arr(i, 1)) = d(arr(i, 1)) + 1
- Next
- For i = 1 To UBound(arr)
- brr(i, 1) = d(arr(i, 1))
- Next
- .Range("c2").Resize(UBound(brr), UBound(brr, 2)) = brr
- End With
- End Sub
复制代码 |
|