|
Option Explicit
Sub TEST6()
Dim ar, br, cr, i&, j&, k&, r&
Application.ScreenUpdating = False
With Range("H6", Cells(Rows.Count, "K").End(xlUp))
ar = .Columns("A:B")
For i = 1 To UBound(ar)
ar(i, 2) = .Rows(i)
Next i
End With
br = Split([A2].Value)
ReDim cr(1 To (UBound(br) + 1) * (UBound(ar) - 1))
For j = 0 To UBound(br)
For i = 1 To UBound(ar)
If ar(i, 1) = br(j) Then
For k = 2 To UBound(ar(i, 2), 2)
r = r + 1
cr(r) = ar(i, 2)(1, k)
Next k
Exit For
End If
Next i
Next j
[F2].Value = Join(cr)
Application.ScreenUpdating = True
Beep
End Sub
|
评分
-
1
查看全部评分
-
|