|
参与一下。。。- Sub ykcbf() '//2024.2.19
- 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, 20)
- End With
- For i = 4 To UBound(arr)
- s = arr(i, 2)
- d(s) = arr(i, 20)
- Next
- With Sheets("工资总表")
- r = .Cells(.Rows.Count, "a").End(xlUp).Row
- For i = 6 To r
- s = .Cells(i, 2)
- If d.Exists(s) Then
- .Cells(i, 6) = d(s)
- Else
- .Cells(i, 6) = ""
- End If
- Next
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|