根据D列的要求在C列提取对应的信息
根据D列的要求在C列提取对应的信息=IF(ISERR(FIND("_",C2)),C2,MID(C2,FIND("_",C2)+1,FIND(")",C2)-FIND("_",C2))) 这样?
=IFERROR(MID(C2,FIND("_",C2)+1,FIND(")",C2)-FIND("_",C2)),C2) VBA 如果把结果放在H~J列
Private Sub CommandButton1_Click()
Dim i, j, n, arr, brr, crr()
Application.ScreenUpdating = False
.CurrentRegion.Offset(1).ClearContents
Set d = CreateObject("scripting.dictionary")
arr = .CurrentRegion
brr = Range("D1:D" & Range("d65536").End(xlUp).Row)
ReDim crr(1 To UBound(arr), 1 To 3)
For j = 2 To UBound(brr)
For i = 2 To UBound(arr)
If InStr(arr(i, 3), brr(j, 1)) Then
n = n + 1
d(arr(i, 3)) = n
crr(n, 1) = arr(i, 1)
crr(n, 2) = arr(i, 2)
crr(n, 3) = arr(i, 3)
End If
Next
Next
.Resize(n, 3) = crr
End Sub
页:
[1]