|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
重在参与。。。
- Sub ykcbf() '//2024.3.14
- Dim arr, d
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("表一")
- r = .Cells(.Rows.Count, 4).End(xlUp).Row
- c = .UsedRange.Columns.Count
- arr = .[a1].Resize(r, c)
- End With
- For i = 5 To UBound(arr)
- For j = 5 To UBound(arr, 2)
- s = arr(i, 4) & "|" & arr(4, j)
- d(s) = arr(i, j)
- Next
- Next
- With Sheets("表二")
- r = .Cells(.Rows.Count, 3).End(xlUp).Row
- c = .UsedRange.Columns.Count
- arr = .[a1].Resize(r, c)
- For j = 4 To UBound(arr, 2)
- For i = 6 To UBound(arr)
- s = arr(5, j) & "|" & arr(i, 3)
- If d.Exists(s) Then
- arr(i, j) = d(s)
- End If
- Next
- Next
- .[a1].Resize(r, c) = arr
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|