|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub lqxs()
- Application.ScreenUpdating = False
- 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.[a3].CurrentRegion
- For i = 2 To UBound(Arr)
- If Arr(i, 17) <= Arr(i, 16) Then
- d(Arr(i, 3)) = d(Arr(i, 3)) + Arr(i, 13)
- If Not d1.exists(Arr(i, 3)) Then d1(Arr(i, 3)) = 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), 5): Cells(i + 5, 5) = Arr(t1(i), 6): Cells(i + 5, 6) = Arr(t1(i), 7)
- Cells(i + 5, 7) = Arr(t1(i), 12): Cells(i + 5, 10) = Arr(t1(i), 11)
- Next
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
2
查看全部评分
-
|