|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
参与一下。。。
- Sub ykcbf3() '//2024.6.25
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- Set d = CreateObject("Scripting.Dictionary")
- b = [{5,10,15,20,25,30,50}]
- ReDim brr(1 To 1000, 1 To 100)
- With Sheets("Sheet1")
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .[a1].Resize(r, 3)
- For i = 2 To UBound(arr)
- s = arr(i, 1)
- If Not d.exists(s) Then
- m = m + 1
- d(s) = m
- brr(m, 1) = s
- End If
- r = d(arr(i, 1))
- c = 1
- For x = 1 To UBound(b)
- If arr(i, 3) <= b(x) Then
- c = x + c
- brr(r, c) = brr(r, c) + 1
- Exit For
- End If
- Next
- Next
- .[h2:o1000].ClearContents
- .[h2].Resize(m, UBound(b) + 1) = brr
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
3
查看全部评分
-
|