Deleting a Row based on cell value

  • Thread starter Thread starter Babu
  • Start date Start date
B

Babu

Friends

My work sheet contains 5000 rows
I have to delete entire row when ever
Column A contain data "NA"
How to automate this?

Thanks in advance
Babu
 
Babu,

Use a macro

Private Sub DeleteNA()

Dim x As Integer
For x = 5000 To 1 Step -1
If Sheets("Sheet1").Range("A" & x).Value = "NA" Then
Rows(x).EntireRow.Delete
End If
Next x

End Sub

HTH
Henry
 
If it's a one off deletion, you could filter the list to show just NA
then delete the whole lot at once.
 
Back
Top