|
來個進階版//不複雜...比正則更容學習...只在"斷句"而已...會用 mid/left 即可//
Sub Test_A1() 'By.准提部林
Dim i&
For i = 1 To 9
Cells(i, 2) = SSS(Cells(i, 1))
Next i
End Sub
Function SSS(ST$) As String
Dim j%, k%, T$, S$, X$, Y%, V$, n%
S = Replace(ST, Chr(10), ""): T = " " & S
For j = 2 To Len(T)
X = Mid(T, j): Y = 0
V = Mid(Val(1 & X), 2)
If InStr("(【<<", Mid(T, j - 1, 1)) Then Y = 1
If X Like V & "、*" Or X Like V & "[】)>>]*" Then
k = j - Y - 1
If k > 1 Then
S = Left(S, k + n - 1) & Chr(10) & Mid(S, k + n)
n = n + 1
End If
j = j + Len(V) + 1
End If
j01: Next j
SSS = S
End Function
|
|