If,Then语句的异常

时间:2019-12-18 15:08:10

标签: excel vba if-statement

对于100k +行的数据转储,我试图擦除两列中出现的所有非零值。但是,如果在第三列中有一组特定的值,我不会删除该行。请帮忙!下面是我的代码:

Dim N As Long, i As Long
    N = Cells(Rows.Count, "V").End(xlUp).Row
    For i = N To 2 Step -1
        If (Cells(i, "V") <> "0" Or Cells(i, "X") <> "0") Then
            'need to add a line that will erase all non zeros except if they contain MX, AA, etc.
            Cells(i, "H").EntireRow.Delete
        End If
    Next i

0 个答案:

没有答案