|
楼主 |
发表于 2024-8-4 17:53
|
显示全部楼层
Sub test0726()
Dim i&, j&, arr, r As Range, d As Object
Set d = CreateObject("Scripting.Dictionary")
With Worksheets("亲民")
arr = .Range("AE1284:AE2483").Value
For i = 1 To UBound(arr)
If arr(i, 1) <> "" Then d(arr(i, 1)) = i + 1283
Next
Set r = .Range("AI2485:BB50000")
arr = r.Value
For i = 1 To UBound(arr)
For j = 1 To UBound(arr, 2)
If d.exists(arr(i, j)) Then
.Cells(d(arr(i, j)), j + 34).Copy r.Cells(i, j)
End If
Next
Next
End With
Set r = Nothing
Set d = Nothing
End Sub |
|