I have a large report that I pull each month listing which products we sold last month. There are certain products I don't want included in the report. Until I can have the report re-written, I'm looking for a macro or a function that will find all the rows that contain these product numbers in column M and delete the entire row. The product numbers I need to delete are always the same, but some months one or more of them might not be in the report if they weren't sold.
In Summary:
Find in column M the product numbers:
c1000
316140a
316140
316295a
316295
316311a
316311
316451a
316451
316450a
316450
316452a
316452
Delete those rows containing the product numbers above
Thanks in advance for any help!
ETA: I found a code (below) but when I highlight my row and run the macro, it deletes the first instance, but then I get an error saying "Object Required"
Sub Deleteit()
Dim c As Range
For Each c In Selection
If c = "C1000" Then c.EntireRow.Delete
If c = "316140" Then c.EntireRow.Delete
If c = "316140A" Then c.EntireRow.Delete
If c = "316295" Then c.EntireRow.Delete
If c = "316295A" Then c.EntireRow.Delete
If c = "316311" Then c.EntireRow.Delete
If c = "316311A" Then c.EntireRow.Delete
If c = "316451" Then c.EntireRow.Delete
If c = "316451A" Then c.EntireRow.Delete
If c = "316450" Then c.EntireRow.Delete
If c = "316450A" Then c.EntireRow.Delete
If c = "316452" Then c.EntireRow.Delete
If c = "316452A" Then c.EntireRow.Delete
Next
End Sub
Bookmarks