Avatar of Euro5
Euro5
Flag for United States of America

asked on 

VBA delete complete row if cells blank

I want to delete the entire row if both column A & column B are blank.
The below uses just the column A - but I also have to add the column B.
Can anyone help?

Sub DeleteBlankRows()
    Dim Ws As Excel.Worksheet
    For Each Ws In ThisWorkbook.Worksheets
    
Application.ScreenUpdating = False
Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Application.ScreenUpdating = True

    Next
End Sub

Open in new window

VBAMicrosoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Bill Prew

8/22/2022 - Mon