全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 Excel
1747 2
2011-07-01
如何利用VB程序一次性删除数据表中要求数字单元格所在的行?
详见附件。
谢谢。
附件列表

如何利用VB程序一次性删除数据表中要求数字单元格所在的行?.rar

大小:11.65 KB

 马上下载

本附件包括:

  • 如何利用VB程序一次性删除数据表中要求数字单元格所在的行?.xlsx

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2011-7-1 21:55:24
Sub DelRow()
'Before runing this code, make sure
'1. Delete all the merged ranges
'2. The first row is your title row
'3. Column G include the exactly value 0.01 which marks the row you want to delete
Dim nr As Long
Dim ws As Worksheet
Set ws = Worksheets(1) 'Make sure the first sheet is the original sheet
ws.Select
nr = ws.UsedRange.Rows.Count

Dim i As Long
For i = nr To 2 Step -1
If Cells(i, 7) = 0.01 Then
ws.Rows(i).Delete
End If
Next i
End Sub
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-6-29 17:54:33

Sub aa()
Dim i As Integer
For i = 2 To Range("A65536").End(xlUp).Row
    If Cells(i, 7) = 0.01 Then
        Cells(i, 7).EntireRow.Delete
        i = i - 1
    End If
Next
End Sub
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群