|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
参与一下。。。
- Sub ykcbf() '//2024.5.28
- Dim arr, d
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("成绩登记")
- r = .Cells(.Rows.Count, "a").End(xlUp).Row
- arr = .[a1].Resize(r, 4)
- End With
- For i = 4 To UBound(arr)
- s = arr(i, 1) & "|" & arr(i, 2)
- d(s) = arr(i, 4)
- Next
- With Sheets("成绩汇总")
- r = .Cells(.Rows.Count, "a").End(xlUp).Row
- arr = .[a1].Resize(r, 4)
- For i = 4 To UBound(arr)
- s = arr(i, 1) & "|" & arr(i, 2)
- If d.Exists(s) Then
- arr(i, 4) = d(s)
- End If
- Next
- .[a1].Resize(r, 4) = arr
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|