在 Excel 中,是否可以使用vlookup
或if
函数,如果数据为 0,则应删除该行?例如:
If cell B1=0 then DELETE cell b1, and if cell B1=1 then UNCHANGED
答案1
尝试宏主要的():
Sub MAIN()
Dim rng As Range, v As Variant
Set rng = Range("B1")
v = 0
Call RowKiller(rng, v)
End Sub
Sub RowKiller(r As Range, v As Variant)
If r.Value = v Then
r.EntireRow.Delete
End If
End Sub