|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
魏老师:你这是假设表格中不存在数字的情况下,添加了一个小数点(如果还不行,就在表格下面加一个空行再用"^13[0-9]{1,}."来查找了!)。“<”不太靠谱!请重新试试:
- Sub aaaa_FindActiveDocument_Numbers_222()
- Dim n&
- With ActiveDocument.Content.Find
- .Execute "[^13^l]", , , 1, , , , , , "^p", 2
- .ClearFormatting
- .Text = "<[0-9]{1,}."
- .Forward = True
- .MatchWildcards = True
- Do While .Execute
- With .Parent
- If .Information(12) Then GoTo skip
- n = n + 1
- .Font.Color = wdColorRed
- ' .Start = .End
- End With
- skip:
- Loop
- End With
- MsgBox "n = " & n, 0 + 48
- End Sub
复制代码 |
|