|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
合计也写进去。
- Sub ykcbf2() '//2024.11.11
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("每日最强")
- r = .Cells(Rows.Count, 2).End(3).Row
- c = .Cells(1, Columns.Count).End(1).Column
- arr = .[a1].Resize(r, c)
- For i = 2 To UBound(arr)
- s = CStr(arr(i, 2))
- Sum = Application.Sum(.Cells(i, 27).Resize(, c - 26))
- For j = 27 To UBound(arr, 2) '//日期超始列号
- If arr(i, j) <> Empty Then
- d(s) = Array(Sum, arr(1, j), arr(i, j))
- Exit For
- End If
- Next
- Next
- End With
- On Error Resume Next
- With Sheets("1判每日取数判断(公)")
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .[a1].Resize(r, 19)
- For i = 2 To UBound(arr)
- s = CStr(arr(i, 2))
- If d.exists(s) Then
- arr(i, 16) = d(s)(0)
- arr(i, 18) = d(s)(1)
- arr(i, 19) = d(s)(2)
- End If
- Next
- .Columns(2).NumberFormatLocal = "@"
- .[a1].Resize(r, 19) = arr
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|