|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
挺麻煩的:
Sub TEST_A1()
Dim Arr, Brr(1 To 20000, 1 To 7), i&, j%, N&, C%, V%, T$, T1$, T2$, TT$
Sheets("结果").UsedRange.ClearContents
Arr = Range(Sheets(1).[A1], Sheets(1).[A65536].End(xlUp))
For i = 1 To UBound(Arr)
T = Trim(Replace(Arr(i, 1), " ", ""))
If T = "" Then GoTo 101
T1 = StrConv(T, vbNarrow)
If Left(T1, 1) Like "[A-Z]" Then C = C + 1: Brr(N, C) = T: GoTo 101
'-----------------------------------
N = N + 1: C = 1: V = 0: TT = ""
For j = 1 To Len(T1)
T2 = Mid(T1, j, 3)
If T2 Like "([A-Z])" Or T2 Like "([A-Z][A-Z]" Then V = 1
If InStr("_(√)(×)", T2) Then V = 1
If V = 1 Then
TT = TT & Mid(T, j, 1)
If Mid(T1, j, 1) = ")" Then Exit For
End If
Next j
Brr(N, 1) = Replace(T, TT, "(" & String(9, " ") & ")")
If TT <> "" Then Brr(N, 7) = Mid(Left(TT, Len(TT) - 1), 2)
101: Next i
Sheets("结果").[A1].Resize(N, 7).Value = Brr
End Sub
|
评分
-
1
查看全部评分
-
|