Quick question...What is the criteria of row delete?
Must both Teams be found in Team list to be kept or....
If only one of the teams are found in Team list row must be kept
If no teams are found then the row be deleted....
Try this long way....
Option Explicit
Sub Delete_Teams()
Dim i As Long, ii As Long, lRow As Long
Dim ws As Worksheet, Found As Boolean
Dim String1 As String, Teams As String, Team1 As String, Team2 As String
Dim rng As Range, Team As Variant
Application.ScreenUpdating = True
Set ws = Sheets("Marketing Stats")
lRow = ws.Cells(Rows.Count, "B").End(xlUp).Row
For i = lRow To 2 Step -1
If ws.Cells(i, 2) Like "*NBA Markets" Or ws.Cells(i, 2) = "NCAA: Championship Index" Then GoTo nxt
String1 = ws.Cells(i, 2)
Teams = Left(String1, WorksheetFunction.Find(" (", String1, 1) - 1)
If Teams Like "* v *" Then
Team1 = Left(Teams, WorksheetFunction.Find(" v ", Teams, 1) - 1)
Team2 = Mid(Teams, WorksheetFunction.Find(" v ", Teams, 1) + 3)
Else
Team1 = Left(Teams, WorksheetFunction.Find(" at ", Teams, 1) - 1)
Team2 = Mid(Teams, WorksheetFunction.Find(" at ", Teams, 1) + 4)
End If
With Sheets("Team List").Range("A:A")
Team = Array(Team1, Team2)
For ii = LBound(Team) To UBound(Team)
Set rng = .Find(What:=Team(ii), After:=.Cells(1), LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False)
If Not rng Is Nothing Then
Found = True
Else
Found = False
ws.Cells(i, 2).EntireRow.Delete
GoTo nxt
End If
Next ii
End With
nxt:
Next i
Application.ScreenUpdating = False
End Sub
Bookmarks