VBA中用正则提取加粗的文字如何表达?
发布网友
发布时间:2024-07-02 14:27
我来回答
共1个回答
热心网友
时间:2024-11-26 18:33
Sub 按钮2_Click()
Application.ScreenUpdating = False
i = 0
For j = 1 To Len([a2])
If [a2].Characters(j, 1).Font.Bold = True Then
If i = 0 Then
str1 = str1 & "," & Mid([a2], j, 1)
Else
str1 = str1 & Mid([a2], j, 1)
End If
i = 1
Else
i = 0
End If
Next j
If Len(str1) > 0 Then
arr = Split(str1, ",")
For i = 1 To UBound(arr)
Cells(i + 2, 1) = arr(i)
Next i
End If
Application.ScreenUpdating = True
End Sub
上边是复制别人在excel中的方法,可供参考去修改