Sub 删除行() r = 3 Do While Cells(r, 3).Value <> "" If Cells(r, 12).Value <= 0 And Cells(r, 3).Value <> "" Then Rows(r).Delete r = r - 1 End If r = r + 1 Loop MsgBox ("ok")
Sub 删除行() i = ActiveCell.SpecialCells(xlLastCell).Row for r=i to 3 setup -1 If Cells(r, 12).Value <= 0 And Cells(r, 3).Value <> "" Then Rows(r).Delete End If next MsgBox ("ok")
Sub 删除行() i = ActiveCell.SpecialCells(xlLastCell).Row for r=i to 3 setup -1(这一段运行错误) If Cells(r, 12).Value <= 0 And Cells(r, 3).Value <> "" Then Rows(r).Delete End If Next MsgBox ("ok")