打开宏编辑器,输入如下代码并运行即可删除空行。
Sub DeleteEmptyRows()
lastrow = ActiveSheet.UsedRange.Row - 1 + ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For r = lastrow To 1 Step -1
If Application.CountA(Rows(r)) = 0 Then Rows(r).Delete
Next r
Application.ScreenUpdating = True
End Sub
如果要删除空行,执行宏命即可。
评论