|
Sub test()
Application.ScreenUpdating = False
Dim arr, brr, dic As Object, i, j, wb As Workbook, xwb As Workbook
Set wb = Workbooks.Open(ThisWorkbook.Path & "\B.xlsx", 0)
Set dic = CreateObject("scripting.dictionary")
arr = wb.Sheets(1).Range("a1").CurrentRegion.Value
wb.Close
For i = 2 To UBound(arr)
If Len(arr(i, 4)) > 0 Then
s = arr(i, 4) & arr(i, 7)
dic(s) = arr(i, 2)
End If
Next
brr = Sheet1.Range("a1").CurrentRegion.Value
For j = 2 To UBound(brr)
s = brr(j, 4) & brr(j, 5)
brr(j, 6) = dic(s)
Next
Sheet1.Range("a1").Resize(UBound(brr), UBound(brr, 2)) = brr
Set dic = Nothing
Set wb = Nothing
MsgBox "完成!"
Application.ScreenUpdating = True
End Sub
|
评分
-
1
查看全部评分
-
|