|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
参与一下。。。- Sub ykcbf() '//2024.5.17
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("人员信息表(合同)")
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .[a1].Resize(r, 2)
- End With
- For i = 2 To UBound(arr)
- s = Replace(arr(i, 2), " ", "")
- d(s) = arr(i, 1)
- Next
- With Sheets("合同编号")
- r = .Cells(Rows.Count, 3).End(3).Row
- c = .UsedRange.Columns.Count
- For i = 4 To r
- s = Replace(.Cells(i, 3), " ", "")
- If d.exists(s) Then
- For j = 4 To c
- If InStr(d(s), .Cells(4, j)) Then
- .Cells(i, j) = d(s)
- Else
- .Cells(i, j) = ""
- End If
- Next
- End If
- Next
- End With
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
2
查看全部评分
-
|