如何删除无数据行(多列)
时间:2011-08-02
来源:互联网
大家好,小弟有个问题请教,如何在一个多列数据的表格中,删除没有数据的行呢?
上次有个朋友建议一个小代码,但只在单列中有效。
mehrspalte.zip(6.54 KB)
上次有个朋友建议一个小代码,但只在单列中有效。
复制内容到剪贴板
Range("E5:E31").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete
End Sub
我上传了一个例子,请大家帮帮忙。谢谢!代码:
Sub Macro1()Range("E5:E31").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete
End Sub

附件

2011-8-2 19:03, 下载次数: 4
作者: bermong 发布时间: 2011-08-02
For x = Sheets(1).UsedRange.Rows.Count To 1 Step -1
k = ""
For Each ce In Rows(x).Cells
k = k & ce
Next
If Len(k) = 0 Then
MsgBox x
Rows(x).Delete
End If
Next
k = ""
For Each ce In Rows(x).Cells
k = k & ce
Next
If Len(k) = 0 Then
MsgBox x
Rows(x).Delete
End If
Next
作者: 7433518 发布时间: 2011-08-02
for each c in Sheet1.UsedRange.rows
if c.find("*")is nothing then
if r is nothing set r=c else set r=union(r,c)
endif
next
if not r is nothing then r.delete(3)
if c.find("*")is nothing then
if r is nothing set r=c else set r=union(r,c)
endif
next
if not r is nothing then r.delete(3)
作者: Zamyi 发布时间: 2011-08-02
植入 VB editor 里面后, 运行不了呀。还请多多指教

作者: bermong 发布时间: 2011-08-02
运行有错误,也没有成功,郁闷了。 能不能帮我做个示范呢?

作者: bermong 发布时间: 2011-08-02
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28