I'm a beginner with VBA. I have the following simple loop code in order to delete from a data base the rows which have a "na" value on the column 9 cell:
Dim n As Integer
n = 500
For i = 1 To n
If Cells(i, 9).Value = "n.a." Then
Rows("i:i").Select
Selection.Delete Shift:=xlUp
End If
Next i
End Sub
But I get the 1004 error, could anyone help me please?