I have this code that I have attempted to modify(obviously incorrectly) to search for a text string in a column and then delete any rows if that value is found. Currently I have it set to find a single text string "api", but I would like to add more text strings to it. It is not working properly as is and I was hoping someone would be willing to help me troubleshoot. The original code was written by Jbeaucaire. The code will select the range but then I'm receiving a run time 424 -object required error...
Sub FINDValuesAndUpdate()
Dim vRNG As Range, v As Range, vFIND As Range
Set vRNG = ActiveSheet.Range(ActiveCell, ActiveCell.End(xlDown)).Select 'these are the values to search for one at a time
'Range(ActiveCell, ActiveCell.End(xlDown)).Select
With ActiveSheet
On Error Resume Next
For Each v In vRNG
Set vFIND = .Range("a:a").Find(v.Value, LookIn:=xlValues, LookAt:=xlWhole)
If Not vFIND Is Nothing Then 'value found, update the column A value
.Range("A" & vFIND.Row).Delete
Set vFIND = API
Else
v.Interior.ColorIndex = 3 'colors the values not found
End If
Next v
End With
End Sub
Bookmarks