Hi , my question is how to loop through the range( column) and delete every 11th value if it is a number, or if it is not a text( both works).
Product
product name
123
123
1234
435
564
234
345
3245
NONO
234
So here on the 11th row, I have a text I would like it to be deleted ( whole row) if not text then loop skips.
Trying with my code but it doesn't work:
Product
product name
123
123
1234
435
564
234
345
3245
NONO
234
So here on the 11th row, I have a text I would like it to be deleted ( whole row) if not text then loop skips.
Trying with my code but it doesn't work:
Code:
Sub deletenthifnumber()
Dim LastRow As Long
Dim x As Long
LastRow = .Cells(.Rows.Count, "H").End(xlUp).row
For x = LastRow To 1 Step -1 ' allways loop backwards when deleting rows
If Not IsNumeric(Range("a" & x).Value Then
.Rows(x).Delete
End If
Next x
End With
End Sub