|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 Chip_Kenny 于 2020-7-10 13:23 编辑
- Sub zz()
- Dim a, b, c(), k, s$, n&
- b = Split([i1], ",")
- a = [a2:a103]
- ReDim c(1 To UBound(a), 1 To 100)
- With CreateObject("vbscript.regexp")
- .Pattern = "(\d+\D?)"
- .Global = 1
- For i = 1 To UBound(a)
- If .test(a(i, 1)) Then
- k = Split(Replace(.Replace(a(i, 1), "|$1|"), "||", "|"), "|")
- n = IIf(UBound(k) > n, UBound(k), n)
- For j = 0 To UBound(k)
- c(i, j + 1) = k(j)
- Next
- End If
- Next
- [b2].Resize(i - 1, n) = c
- End With
- End Sub
复制代码 |
|