Delete Rows if any cell in Column H is blank but do not Delete Fir

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

Guest

Hi ,

I need to delete any row which has a blank cell in Column H. But I do not
want to delete the first row because this will have a "Title" even though
Column H is blank.
Thanks
 
Sub Macro1()
Dim i As Long
Set r = ActiveSheet.UsedRange
i = r.Rows.Count + r.Row - 1
For j = i To 2 Step -1
If IsEmpty(Cells(j, "H")) Then
Rows(j).EntireRow.Delete
End If
Next
End Sub
 
Thanks it works

Gary''s Student said:
Sub Macro1()
Dim i As Long
Set r = ActiveSheet.UsedRange
i = r.Rows.Count + r.Row - 1
For j = i To 2 Step -1
If IsEmpty(Cells(j, "H")) Then
Rows(j).EntireRow.Delete
End If
Next
End Sub
 
Back
Top