|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
参与一下。。。
- Sub ykcbf() '//2024.6.13
- Dim arr, brr, d
- Application.ScreenUpdating = False
- Set d = CreateObject("scripting.dictionary")
- With Sheets("Sheet1")
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .[a1].Resize(r, 7)
- End With
- ReDim brr(1 To UBound(arr), 1 To 7)
- For i = 3 To UBound(arr)
- s = arr(i, 2) & "|" & arr(i, 5)
- If Not d.Exists(s) Then
- m = m + 1
- d(s) = m
- brr(m, 1) = m
- For j = 2 To UBound(arr, 2)
- brr(m, j) = arr(i, j)
- Next
- Else
- r = d(s)
- brr(r, 7) = brr(r, 7) + arr(i, 7)
- End If
- Next
- With Sheets("贴息汇总")
- .[a3:g1000] = ""
- .Range("a3").Resize(m, 7) = brr
- Set Rng = .[b3].Resize(m, 6)
- Rng.Sort .[b3], 1
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|