|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
参与一下。。。
- Sub ykcbf() '//2024.8.29
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- p = ThisWorkbook.Path & ""
- Set sh = ThisWorkbook.Sheets("Individual")
- f = p & "2025.xlsb"
- Set wb = Workbooks.Open(f, 0)
- With wb.Sheets("list")
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .[a1].Resize(r, 23)
- End With
- wb.Close 0
- For i = 2 To UBound(arr)
- If arr(i, 4) = "TX" Then
- s = CStr(arr(i, 6)) & "|" & CDate(arr(i, 7))
- d(s) = d(s) + Val(arr(i, 19))
- End If
- Next
- With sh
- r = .Cells(Rows.Count, 2).End(3).Row
- For i = 2 To r
- For j = 216 To 246
- s = CStr(.Cells(i, 2).Value) & "|" & CDate(.Cells(1, j).Value)
- If d.exists(s) Then
- .Cells(i, j).Value = d(s)
- End If
- Next
- Next
- ActiveWindow.DisplayZeros = False
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|