删除Excel中所有完全空白的行

cap*_*rad 2 excel vba row

我在当前的工作簿中使用了几千行.然而,有几百行是完全空白的.

如何选择每一行(仅限那些完全空白的行)并将其删除?

bon*_*svr 9

有两种方法可以做到这一点:

1.使用VBA:

此链接中有一个VBA脚本.使用第一个脚本,我的意思是DeleteBlankRows.

您也可以从此处复制相同的代码.

如何使用:

Copy the code.
In Excel press Alt + F11 to enter the VBE.
Press Ctrl + R to show the Project Explorer.

Insert -> Module.
Paste code.
Save and Exit VBE.
Run Code Online (Sandbox Code Playgroud)

运行代码:

Select the column with blank rows.
Press Alt + F8 to open the macro dialog box.
Select DeleteBlankRows
Click Run.
Run Code Online (Sandbox Code Playgroud)

2.没有VBA:

只需查看此处的链接.这很容易,所以不需要再解释一下.