|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
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), 0)
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, 0) = ar(i, 2)(1, k)
Next k
Exit For
End If
Next i
Next j
Columns("F").ClearContents
[F2].Resize(r) = cr
Application.ScreenUpdating = True
Beep
End Sub |
评分
-
1
查看全部评分
-
|