Skip to content

Instantly share code, notes, and snippets.

@joonro
Created January 22, 2015 22:40
Show Gist options
  • Save joonro/33441afa0d8e17b20fc6 to your computer and use it in GitHub Desktop.
Save joonro/33441afa0d8e17b20fc6 to your computer and use it in GitHub Desktop.
Sub Remove_Missing()
'Set the range to evaluate to rng.
Set Rng = Range("E2:E20001") 'Rng holds the Range object
'initialize i to 1
i = 1
For counter = 1 To Rng.Rows.Count 'number of rows
If Rng.Cells(i).Value = "NA" Then
Rng.Cells(i).EntireRow.Delete
Else
i = i + 1 'why do we use i instead of counter?
End If
Next counter
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment