deleting an entire row if the cell in col A is empty

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

would some one please help me w/ the coding for a loop for deleting an entire
row if the cell in column A is empty. I've tried several FOR EACH loops w/
little success.
Thanks
Zb
 
Sub delete_rows()
Dim RowNdx As Long
Dim LastRow As Long
LastRow = ActiveSheet.UsedRange.Rows.Count
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "A").Value = "" Then
Rows(RowNdx).Delete
End If
Next RowNdx
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top