|
参与一下。。。- Sub ykcbf() '//2024.2.22
- Dim arr, d
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("Sheet1")
- r = .Cells(.Rows.Count, "a").End(xlUp).Row
- arr = .[a1].Resize(r, 22)
- End With
- For i = 2 To UBound(arr)
- s = arr(i, 2)
- d(s) = i
- Next
- On Error Resume Next
- With Sheets("结果")
- r = .Cells(.Rows.Count, "a").End(xlUp).Row
- brr = .[a1].Resize(r, 6)
- For i = 1 To UBound(brr) Step 5
- s = brr(i, 1)
- If d.Exists(s) Then
- For j = 2 To 6
- brr(i + 1, j) = arr(d(s), j + 1)
- brr(i + 2, j) = arr(d(s), j + 12)
- brr(i + 3, j) = arr(d(s), j + 1) - arr(d(s), j + 12)
- Next
- End If
- Next
- .[a1].Resize(r, 6) = brr
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|