|
楼主 |
发表于 2023-5-17 20:44
|
显示全部楼层
老师,这个文件的第二个问题,我用的比较笨的办法,如下,速度很慢,希望能够有更好更快的方法解决;
Sub jisuan1()
Dim rz As Long, rf As Long
Dim arz As Range, arz1 As Range, arf As Range, arf1 As Range
Dim wz As Worksheet, wf As Worksheet
Set wz = Worksheets("现任"): Set wf = Worksheets(5)
Set arz = wz.Range("k2:w59742")
Set arf = wf.Range("b2:n23948")
Set arz1 = wz.Range("j2:j59742")
Set arf1 = wf.Range("o2:o23948")
For rz = 1 To 59742
For rf = 1 To 23948
If arf1(rf) = arz1(rz) Then
arz(rz, 1) = arf(rf, 1)
arz(rz, 2) = arf(rf, 2)
arz(rz, 3) = arf(rf, 3)
arz(rz, 4) = arf(rf, 4)
arz(rz, 5) = arf(rf, 5)
arz(rz, 6) = arf(rf, 6)
arz(rz, 7) = arf(rf, 7)
arz(rz, 8) = arf(rf, 8)
arz(rz, 9) = arf(rf, 9)
arz(rz, 10) = arf(rf, 10)
arz(rz, 11) = arf(rf, 11)
arz(rz, 12) = arf(rf, 12)
arz(rz, 13) = arf(rf, 13)
Exit For
End If
Next rf
Next rz
End Sub
|
|