I need to delete blank rows. Column A is used to number the rows in each section of the spreadsheet. Only the sum function is used in various columns. So this is the task: If Column B is blank and the result of the sum function is 0, then delete the row. I tried this macro and it didn’t accomplish what I needed. Thank you.
Sub deleteEmptyrows()
Dim rowNum As Long
Lastrow = ActiveSheet.UsedRange.row – 1 + _
ActiveSheet.UsedRange.rows.Count
Application.ScreenUpdating = False
For rowNum = Lastrow To 1 Step -1
If Application.CountA(rows(rowNum)) = 0 Then _
rows(rowNum).delete
Next rowNum
End Sub