- ·上一篇教育:word中内容怎么
- ·下一篇教育:已有横线的word怎么打字
怎么选中所有空白单元格word
1.word如何批量删除空行
用Word打开含空行的文章,依次单击“工具” →“宏” →“Visual Basic编辑器”,打开Visual Basic编辑器。双击“Project”下的“ThisDocument”,打开“代码”输入窗口,将下面的代码输入进去,并保存。
Sub DelBlank()
Dim i As Paragraph, n As Integer
Application.ScreenUpdating = False
For Each i In ActiveDocument.Paragraphs
If Len(i.Range) = 1 Then
i.Range.Delete
n = n + 1
End If
Next
MsgBox "共删除空白段落" & n & "个"
Application.ScreenUpdating = True
End Sub
代码输入完毕,单击“工具栏”中的“运行”按钮,执行这段代码。这时,会弹出一个消息窗口,告诉你一共删除了多少空行(如图)
评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)