Jake
Jake

Reputation: 13

How can i delete a row that contains an error cell

Im not too familier with vba, but i want to make a macro that deletes any row that has an error inside one of its cells. I recorded this macro below and if gives me the error: "Run-time error '1004': Delete method of range class failed"

    Sub Macro9()
'
' Macro9 Macro
'

'
    Rows("5:100").Select
    Selection.SpecialCells(xlCellTypeFormulas, 16).Select
    Selection.EntireRow.Delete
End Sub

I would greatly apprecite your help if you know how to fix this. Thank you.

Upvotes: 0

Views: 68

Answers (1)

Gabriel Selvatice
Gabriel Selvatice

Reputation: 1

Hei, you need to order your cell, so all the errors will be together. Afther that you can use your macro

Upvotes: 0

Related Questions