Sorry ignore previous posting. This won't remove all entries as, as each row is deleted, the cell reference goes out of sync.
Try something like this.
Sub test()
Count = Range("A:A".SpecialCells(xlCellTypeLastCell).Row
Do
If Cells(Count, "A" = "ABC" Then
Rows(Count).EntireRow.Delete
End If
Count = Count - 1
Loop Until Count = 0
End Sub
Couldn't leave it as it was as if there is alot of data it could take a while!
As before this will delete all rows where there is ABC in column A.
Sub test()
Set One = Columns("A".Find("ABC", lookat:=xlWhole)
If Not (One) Is Nothing Then
Cells(One.Row, "A".Select
Cells.ColumnDifferences(ActiveCell).EntireRow.Hidden = True
Cells.SpecialCells(xlCellTypeVisible).EntireRow.Delete
Cells.EntireRow.Hidden = False
End If
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.