Hi,
I was trying to do a macro to find a value in a column and delete it from every row.
This is my code:
Dim FoundCell As Range
Application.ScreenUpdating = False
Set FoundCell = Range("C:C").Find(what:="Mobile")
Do Until FoundCell Is Nothing
FoundCell.EntireRow.Delete
Set FoundCell = Range("C:C").FindNext
Loop
In this way I delete all the rows where in the column C there is the word "Mobile".
It's working properly... the problem is that I have many different words to look for and for the moment I am just adding and readding lines of code.
There is a better way???
Now my code is like that:
Dim FoundCell As Range
Application.ScreenUpdating = False
Set FoundCell = Range("C:C").Find(what:="Mobile Device")
Do Until FoundCell Is Nothing
FoundCell.EntireRow.Delete
Set FoundCell = Range("C:C").FindNext
Loop
Set FoundCell = Range("C:C").Find(what:="Supply")
Do Until FoundCell Is Nothing
FoundCell.EntireRow.Delete
Set FoundCell = Range("C:C").FindNext
Loop
Set FoundCell = Range("C:C").Find(what:="Blackberry")
Do Until FoundCell Is Nothing
FoundCell.EntireRow.Delete
Set FoundCell = Range("C:C").FindNext
Loop
The problem is that I can have 20 or 30 words...
Any help will be appreciated.
Thanks
Jsabina
Bookmarks