|
楼主,我水平不高,你试试吧!
Sub test()
Dim i As Long, j As Long
Selection.SelectCell
Selection.Find.Execute FindText:="^13", ReplaceWith:="^p", Replace:=wdReplaceAll '假回车全部替换为真回车
Do
Selection.SelectCell
Selection.Find.Execute FindText:="^l", ReplaceWith:="`"
If Selection.Find.Found = True Then i = i + 1 Else Exit Do
Loop
Do
Selection.SelectCell
Selection.Find.Execute FindText:="^p", ReplaceWith:="`"
If Selection.Find.Found = True Then j = j + 1 Else Exit Do
Loop
Selection.SelectCell
Selection.Find.Execute FindText:="`", ReplaceWith:="^p", Replace:=wdReplaceAll '还原
MsgBox "单元格段落行数 = " & i + j + 1
End Sub |
|