|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
'这个应该能看懂吧
Option Explicit
Sub test()
Dim arr, mark, i, j, k, pos, n, t, max
mark = ".0123456789"
arr = Range("a2:a" & Cells(Rows.Count, "a").End(xlUp).Row)
ReDim brr(1 To UBound(arr, 1), 1 To 10 ^ 2)
For i = 1 To UBound(arr, 1)
If InStr(arr(i, 1), "(") Then
n = 0: pos = 1
t = Split(arr(i, 1), "(")(1)
t = Replace(t, ")", vbNullString) & "0"
For j = 1 To Len(t)
If InStr(mark, Mid(t, j, 1)) = 0 Then
For k = j To Len(t)
If InStr(mark, Mid(t, k, 1)) > 0 Then
n = n + 1: brr(i, n) = Mid(t, pos, k - pos)
If max < n Then max = n
pos = k: j = k: Exit For
End If
Next
End If
Next
End If
Next
[b2].Resize(UBound(arr, 1), max + 1) = brr
End Sub |
评分
-
1
查看全部评分
-
|