Excel 如何快速删除空白行
时间:2023-12-10 01:08:35
Excel 中处理网络上或者第三方软件导出的数据时,经常遇到 Excel 文档行和行出现多余空白行的情况,这些多余的空白行会影响数据的直观且占用和浪费空间。怎么简单方便的删除这些空白行呢?肯定不能一行一行的删除,那样费时又费力,好,今天我么就给大家提供两种简变的方法(源数据如图):
一、利用 Excel快速定位功能
1、选中需要删除空行的区域,点击 开始 标签 --> 编辑 组 --> 查找和选择 菜单 --> 定位条件... 菜单项 调出 定位条件 对话框,选择 空白 选项
2、右键单击任意一个定位中的整行都是空白的单元格,在弹出菜单中选择 删除 按钮
3、在弹出的删除对话框中选择 整行 选项,然后点击 确定 按钮即可
二、VBA 代码
打开 VBE 编辑器,新建一个标注模块,在模块中添加后面所列的代码,然后将光标定位到代码中,按 F5 键运行代码即可,代码如下:
Sub DeleteBlankRows()
Dim I As Long
Dim Rg As Range
Dim xCalculation As XlCalculation
Dim xScreenUpdating As Boolean
xCalculation = Application.Calculation
xScreenUpdating = Application.ScreenUpdating
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Set Rg = ThisWorkbook.ActiveSheet.UsedRange
For I = Rg.Rows.Count To 1 Step -1
If WorksheetFunction.CountA(Rg.Rows(I)) = 0 Then
Rg.Rows(I).EntireRow.Delete
End If
Next I
Application.Calculation = xCalculation
Application.ScreenUpdating = xScreenUpdating
End Sub
Excel 如何快速删除空白行的下载地址:
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
AREAS函数
![](https://img.aspxhome.com/file/2023/3/a142503_0s.png)
腾讯电脑管家如何设置文件系统防护效果
![](https://img.aspxhome.com/file/2023/9/a341523_0s.png)
如何在Excle表格中制作一个按钮?
XP系统下提取Word文档图片的方法
![](https://img.aspxhome.com/file/2023/3/a295516_0s.jpg)
Furmark怎么设置中文?Furmark设置中文界面的方法
![](https://img.aspxhome.com/file/2023/7/a327415_0s.jpg)
怎样在Word2010文档中创建图表
![](https://img.aspxhome.com/file/2023/5/30145_0s.jpg)
电脑安装系统失败怎么办_电脑安装系统失败重装还原教程
![](https://img.aspxhome.com/file/2023/3/a296233_0s.jpg)
excel表格PRODUCT函数如何使用
win8怎么隐藏文件?Win8系统把文件存到图片中的教程
![](https://img.aspxhome.com/file/2023/29/a251237_0s.jpg)
Win11如何更改exe文件后缀?Win11更改exe文件后缀的方法
![](https://img.aspxhome.com/file/2023/28/a239131_0s.png)
word编辑文档前,做的第一件事情是什么?
![](https://img.aspxhome.com/file/2023/7/32297_0s.png)
excel复选框控件使用实例教程
![](https://img.aspxhome.com/file/2023/8/a154368_0s.png)
美图秀秀如何进行人物抠图换背景?美图秀秀app人物抠图的操作步骤
![](https://img.aspxhome.com/file/2023/7/a329269_0s.png)
Win10提示你的设备中缺少重要的安全和质量修复解决方法
![](https://img.aspxhome.com/file/2023/1/a278325_0s.png)
excel中填充控制柄的使用方法
微软跪了!美国最最最机密地方电脑系统还停留在Win95/98
![](https://img.aspxhome.com/file/2023/3/a292444_0s.jpg)
如何用excel进行数据分析的教程
excel使用“自动填充”功能输入连续的数字
![](https://img.aspxhome.com/file/2023/2/a141312_0s.jpg)
Win7系统怎么进行极限优化?
![](https://img.aspxhome.com/file/2023/1/a281759_0s.png)
如何避免被收取额外费用?取消 Apple news+ 订阅试用的教程
![](https://img.aspxhome.com/file/2023/7/a197907_0s.jpg)