none
Determine if activecell has #DIV/0! error RRS feed

  • Question

  • I need to delete all rows on a sheet that have #DIV/0! error in column D.  There can be other errors that are allowed.  

    Thanks

    Wednesday, February 24, 2016 3:40 PM

Answers

  • This assumes headers in row 1:

    Sub Test()

        Range("D:D").AutoFilter Field:=1, Criteria1:="#DIV/0!"
        Intersect(ActiveSheet.UsedRange.Offset(1), Range("D:D")).EntireRow.Delete
        Range("D:D").AutoFilter

    End Sub

    • Marked as answer by dbdrtso1 Wednesday, February 24, 2016 7:10 PM
    Wednesday, February 24, 2016 5:55 PM