|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub 提取名字()
Sheet2.[a1].CurrentRegion = ""
Dim wz$, brr(), crr()
wz = "朱清燕(女),林鑫,林秋静(女),林永鑫,林云艳(女),林嘉惠(女),曾文婷(女),林悦,陈诚,林伟健,赖紫岚(女),曾雁(女),赖文强,钟娟(女),张琪(女),林文彬,黄晓婷(女),李朕,林依婷(女),林佳利(女),曾德福"
xm = Split(wz, ",")
ReDim brr(LBound(xm) To UBound(xm))
ReDim crr(LBound(xm) To UBound(xm))
For i = LBound(xm) To UBound(xm)
If InStr(xm(i), "(") <> 0 Then
brr(i) = Left(xm(i), InStr(xm(i), "(") - 1)
crr(i) = Mid(xm(i), InStr(xm(i), "(") + 1, 1)
Else
brr(i) = xm(i)
crr(i) = ""
End If
Next
Sheet2.[a1].Resize(UBound(xm), 1) = Application.WorksheetFunction.Transpose(brr)
Sheet2.[b1].Resize(UBound(xm), 1) = Application.WorksheetFunction.Transpose(crr)
End Sub |
|