Test the next code, please. It needs a text file named "input.txt". In my example code it is located in the folder where ThisWorkbook
has the path:
Sub RemoveRowsAv()
Dim sh As Worksheet, n As Long, d As Long, arrCond, El, txtFileName As String
Dim objFSO As Object, objTxt As Object, rngDel As range, strText As String
Set sh = ThisWorkbook.ActiveSheet 'use here the necessary sheet (not necessary to be activated)
sh.cells.ClearFormats
txtFileName = ThisWorkbook.Path & "\" & "input.txt" 'fill here the text file full name
Set objFSO = CreateObject("Scripting.FileSystemObject")
If Not objFSO.FileExists(txtFileName) Then 'check if the text file exists in the path
MsgBox "The text file does not exist on the path: """ & txtFileName & """."
Exit Sub
End If
Set objTxt = objFSO.OpenTextFile(txtFileName, 1)
strText = objTxt.ReadAll 'read the text file content
objTxt.Close
arrCond = Split(strText, vbCrLf) 'put it in an array splitting on vbCrLf (end of line)
n = range("G" & rows.count).End(xlUp).row 'last row of the G:G column
For d = 1 To n 'iterate between the existing range
For Each El In arrCond 'check each element of the array keeping conditions
If El <> "" Then
If InStr(1, sh.cells(d, 7).text, El, vbTextCompare) > 0 Then
If rngDel Is Nothing Then 'if the range to be deleted not Set
Set rngDel = sh.cells(d, 7)
Else
Set rngDel = Union(rngDel, sh.cells(d, 7)) 'if already Set
End If
End If
End If
Next El
Next d
'delete all the rows at once:
If Not rngDel Is Nothing Then rngDel.EntireRow.Delete xlUp
End Sub