I have an accounting worksheet where the names of the account are populated using a lookup to a master data set. This lookup leaves the value 0 (zero) for any account number that does not exist in the master data set. So now I want code that will delete all rows where the value in the row for column A is 0 (zero).
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
Assuming your data starts in cell A1, and your column A is formatted as General, you can use the following autofilter code:
with Cells(1,1).currentregion.autofilter.autofilter field:=1, criteria1:="0".offset(1).resize(.rows.count-1).specialcells(xlcelltypevisible).entirerow.delete.autofilterend with
Open in new window