Excel批量删除空行和空列
删除空余行宏代码:
Dim LastRow As Long, r As Long LastRow = ActiveSheet.UsedRange.Rows.Count LastRow = LastRow + ActiveSheet.UsedRange.Row -1 For r = LastRow To 1 Step -1 If WorksheetFunction.CountA(Rows(r)) = 0 Then Rows(r).Delete Next r
删除空余列宏代码:
Dim LastColumn As Long, c As Long LastColumn = ActiveSheet.UsedRange.Columns.Count LastColumn = LastColumn + ActiveSheet.UsedRange.Column For c = LastColumn To 1 Step -1 If WorksheetFunction.CountA(Columns(c)) = 0 Then Columns(c).Delete Next c
- 批量将csv转换成excel文件xlsx格式
- Excel批量删除指定字符所在行
- wps和excel添加转置快捷键的方法
- EXCEL批量在数字前加半角单引号
- 批量合并EXCEL工作薄文件
- 使用宏代码批量将csv文件合并在一个xslx表格文件里
- 网上下载的EXCEL文件打开提示内存或磁盘空间不足的解决方法
- Excel将一列数据批量处理截取成多列数据
本文标题:《Excel批量删除空行和空列》
网址:https://zhangwenbao.com/excel-batch-deleting-empty-and-empty-columns.html