|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
参与一下。。。
- Sub ykcbf() '//2024.12.19
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- Arr = Sheets("任职").[a2:o8]
- For i = 2 To UBound(Arr)
- For j = 3 To UBound(Arr, 2)
- s = Arr(i, 2) & "|" & Arr(1, j)
- d(s) = Arr(i, j)
- Next
- Next
- On Error Resume Next
- With Sheets("排正课表")
- r = .Cells(Rows.Count, 1).End(3).Row
- c = .UsedRange.Columns.Count
- Arr = .[a1].Resize(r, c)
- For i = 5 To UBound(Arr) Step 2
- For j = 2 To UBound(Arr, 2)
- s = Arr(i, 1) & "|" & Arr(i, j)
- If d.exists(s) Then
- Arr(i + 1, j) = d(s)
- Else
- Arr(i + 1, j) = ""
- End If
- Next
- Next
- .[a1].Resize(r, c) = Arr
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|