Aug 16 2021 10:04 AM
Hello,
I'm trying to create a macro that deletes all lines in a workbook having specific values, here is my code:
Sub DeleteRowswithSpecificValue()
Dim cell As Range
For Each cell In Range("x2:x2000")
If cell.Value = "defer" Then
cell.EntireRow.Delete
End If
Next cell
End Sub
The macro serves only to delete the first row containing the value not every row. I'll attach the file I want it to work on.
Thanks in advance!
Aug 16 2021 11:45 AM
If you don't necessarily want to do it with VBA, an alternative with a filter could also help.
Example in the inserted file.
I would be happy to know if I could help.
Nikolino
I know I don't know anything (Socrates)
* Kindly Mark and Vote any reply if it helps please, as it will be beneficial to more Community members reading here.
Aug 16 2021 02:26 PM