Option Explicit
Sub test()
On Error Resume Next
Range("A1").Resize(Cells(Rows.Count, 1).End(xlUp).Row, Cells(1, Columns.Count).End(xlToLeft).Column).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
On Error GoTo 0
Range("A2", Range("A65536").End(xlUp)).FormulaR1C1 = "=ROW(RC)-1"
End Sub