Okay,
I have about 50 rows data and I would like to delete all rows containing the word "Apple" in Column J.
This code gets most values but not all.
Please help.
Sub DeleteAPPLERows() 'or Button1_Click()
Dim Rng As Range, Cell As Range
Set Rng = Range(Range("J2"), Range("J" & Rows.Count).End(xlUp))
For Each Cell In Rng
If Cell = "Apple" Then
Cell.EntireRow.Delete
End If
Next Cell
End Sub
I have about 50 rows data and I would like to delete all rows containing the word "Apple" in Column J.
This code gets most values but not all.
Please help.
Sub DeleteAPPLERows() 'or Button1_Click()
Dim Rng As Range, Cell As Range
Set Rng = Range(Range("J2"), Range("J" & Rows.Count).End(xlUp))
For Each Cell In Rng
If Cell = "Apple" Then
Cell.EntireRow.Delete
End If
Next Cell
End Sub