Automatic Deletion of Rows if Blank
Question:
How can I delete the entire row if the cell I am referring to is blank? For Example if A20 is blank, then I want to delete row 20. Please let me know the formula I need to use.
Answer:
There are two ways which you can achieve the end result. Where formulas can’t delete rows you need to use either Filter or using VBA
1. Using Filter on blank rows and delete all visible rows
2. Using VBA, code given below.
Sub RemoveBlankRows() 'Deletes the entire row within the selection On Error Resume Next Selection.EntireRow.SpecialCells(xlBlanks).EntireRow.Delete On Error GoTo 0 End Sub