Sub TEST()
Dim Arr, A, xD, i&
Set xD = CreateObject("Scripting.Dictionary")
Arr = Range([分類表!A1], [分類表!B65536].End(xlUp))
For i = 2 To UBound(Arr)
For Each A In Split(Arr(i, 2), ","): xD(A & "") = Arr(i, 1): Next
Next i
With Range([工作頁!B2], [工作頁!A65536].End(xlUp))
Arr = .Cells.Value
For i = 1 To UBound(Arr): Arr(i, 1) = xD(Arr(i, 1) & ""): Next
.Columns(2).Value = Arr
End With
End Sub作者: free72921 時間: 2020-4-29 21:53