|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub lqxs()
- Dim Arr, i&
- Dim d, k, t, d1
- Set d = CreateObject("Scripting.Dictionary")
- Set d1 = CreateObject("Scripting.Dictionary")
- Sheet15.Activate
- [c5:j500].ClearContents
- Arr = Sheet9.[c3].CurrentRegion
- For i = 2 To UBound(Arr)
- If Arr(i, 15) <= Arr(i, 14) Then
- d(Arr(i, 1)) = d(Arr(i, 1)) + Arr(i, 11)
- If Not d1.exists(Arr(i, 1)) Then d1(Arr(i, 1)) = i
- End If
- Next
- k = d.keys: t = d.items: t1 = d1.items
- [c5].Resize(d.Count) = Application.Transpose(k)
- [h5].Resize(d.Count) = Application.Transpose(t)
- For i = 0 To UBound(t1)
- Cells(i + 5, 4) = Arr(t1(i), 3): Cells(i + 5, 5) = Arr(t1(i), 4): Cells(i + 5, 6) = Arr(t1(i), 5)
- Cells(i + 5, 7) = Arr(t1(i), 10): Cells(i + 5, 10) = Arr(t1(i), 9)
- Next
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|