Hello:
I am trying to make code to check each cell in Column K that contains data and if that cell contains 80 or 800 then I want to delete that row.
Wasn't working at all so started by trying to just check for cells containing 80 only and deleting that row
Not doing something right. It will delete 1 or 2 rows then stops deleting.
Here is the code I have now
Public Sub Delete()
Dim Cell As Range
Range("k2").Select
For Each Cell In Sheets("Ref").Range("K:K")
If (Cell = 80) Then
Rows(ActiveCell.Row).EntireRow.Delete
End If
Next Cell
End Sub
Would appreciate any ideas
Thanks
Rob
I am trying to make code to check each cell in Column K that contains data and if that cell contains 80 or 800 then I want to delete that row.
Wasn't working at all so started by trying to just check for cells containing 80 only and deleting that row
Not doing something right. It will delete 1 or 2 rows then stops deleting.
Here is the code I have now
Public Sub Delete()
Dim Cell As Range
Range("k2").Select
For Each Cell In Sheets("Ref").Range("K:K")
If (Cell = 80) Then
Rows(ActiveCell.Row).EntireRow.Delete
End If
Next Cell
End Sub
Would appreciate any ideas
Thanks
Rob