Sub mydelete()
For i = 26 To 2 Step -1
If Cells(i, 4) = 0 Or Cells(i, 6) = "请假" Or Cells(i, 6) = "插班生" Or Cells(i, 7) = 0.01 Then
Rows(i).Delete
End If
Next i
End Sub
Option Base 1
Sub DelRow()
Dim firstaddress As String, rng As Range, tmp As Range, Myarr As Variant
Myarr = Array("请假", "插班生", "复读生")
With Range("E:F") '指定信息所在的区域,可以调整为指定的列
For i = 1 To UBound(Myarr)
Set tmp = Nothing
Set tmp = .Find(Myarr(i)) '查找第一个符合条件的单元格
If Not tmp Is Nothing Then '如果存在符合条件的数据行
firstaddress = tmp.Address '保存第一个符合条件单元格的地址
Do
If rng Is Nothing Then '如果存放查询结果的变量未使用过
Set rng = tmp '将第一个符合条件的单元格赋值给变量
Else
Set rng = Union(rng, tmp) '将所有符合条件的单元格保存在同一个变量中
End If
Set tmp = .FindNext(tmp) '继续查找下一个符合条件的单元格
Loop While tmp.Address <> firstaddress '判断是否绕回,以确定是否完成所有数据的查询
'rng.EntireRow.Select
rng.EntireRow.Delete '删除符合条件的数据行
End If
Next
End With
End Sub