|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub TEST()
Dim arr, brr, vData, i&, j&, k&
On Error Resume Next
With Sheets("表1").Range("A1").CurrentRegion
arr = .Resize(, 5)
End With
brr = Range(Cells(Rows.Count, "AE").End(xlUp), "AE6")
ReDim vData(1 To UBound(brr), 1 To 3)
For i = 1 To UBound(brr)
For j = 2 To UBound(arr)
If InStr(brr(i, 1), arr(j, 2)) Then
For k = 1 To 3
vData(i, k) = arr(j, IIf(k = 3, 5, k))
Next k
Exit For
End If
Next j
Next i
[BE6].Resize(UBound(vData), UBound(vData, 2)) = vData
Beep
End Sub |
|