hi guys i looking a code to check a way
if all the columns are empty delete the row
plz find the attachment
hi guys i looking a code to check a way
if all the columns are empty delete the row
plz find the attachment
Try:
Sub DeleteRows()
Application.ScreenUpdating = False
Dim LastRow As Long, x As Long
LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
For x = LastRow To 1 Step -1
If WorksheetFunction.CountA(Rows(x)) = 0 Then
Rows(x).Delete
End If
Next x
Application.ScreenUpdating = True
End Sub
Display More
Please see the revised code in Post #2.
You are very welcome.
Do you want to remove all the blank rows and keep the last row? What is in the last row? Is the cell in column A in the last row blank?
Don’t have an account yet? Register yourself now and be a part of our community!