Hi everyone,
I found below code on the forum to find rows in a list of data that contain a certain value in the column D.
I have 2 questions to ask to the forum and hope somebody can help ;-)
1.) Rather than hard-coding, I would like the "user" to have the possibility to insert the values he wants to have removed.
Those values would be in SHEET "CONFIG" from B10:B20. So what is below as "PINCO" and "PALLO", would be a user-defined list of criteria, so the code below would have to change into a loop.
2.) I would like to have some kind of "if is error, then don't do anything" routine in there, because sometimes maybe not ALL cell values are found, so I don't want the macro to stop, just to ignore the error and proceed.
Sub DelRows()
Sheets("INPUT").Select
Range("A1").Select
With Columns("D")
.Replace "PINCO", "", xlWhole
.SpecialCells(xlCellTypeBlanks).EntireRow.Delete (xlShiftUp)
End With
With Columns("D")
.Replace "PALLO", "", xlWhole
.SpecialCells(xlCellTypeBlanks).EntireRow.Delete (xlShiftUp)
End With
End Sub
Thanks for your help, I am sure this solution will be helpful to others. Also: please don't suggest to manually filter and delete rows, I want to automate that to avoid having to filter and delete rows ;-)
Thanks, TItus
Bookmarks