|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 bajifeng 于 2016-1-15 08:25 编辑
- Sub db() 'bajifeng
- Dim n%, s$, reg As Object, br()
- Set reg = CreateObject("vbscript.regexp")
- With reg
- .Global = True
- .IgnoreCase = True
- .Pattern = "[A-Z][.、][^.、]+(、[A-Z])*[^.、]*((?=[A-Z][.、])|$)"
- End With
- s = "A.ABCB.头晕眼花 C、如何处理 D.上下E.请高手A、B、C指教拆分"
- For Each mh In reg.Execute(s)
- n = n + 1
- ReDim Preserve br(1 To 2, 1 To n)
- br(1, n) = n
- br(2, n) = mh
- Next
- [e2:f10] = ""
- [e2].Resize(n, 2) = Application.Transpose(br)
- End Sub
复制代码
|
|