Set rngAttributes = wsNBA.Range("J63").CurrentRegion
Set rngYup = wsNBA.Range("J63:J75")
Do Until rngAttributes.Cells(RowIndex:=intrRow, columnIndex:=1).Value = strTeamName _ Or rngAttributes.Cells(RowIndex:=intrRow, columnIndex:=10).Value = ""
intRow = intRow + 1
Loop
If rngAttributes.Cells(RowIndex:=intrRow, columnIndex:=1).Value = strTeamName Then
For Each cell In rngYup
If cell.Value = strTeamName Then
strAttributes = rngAttributes.Cells(RowIndex:=intRow, columnIndex:=2).Value
intRow = intRow + 1
End If
Next
Else
strAttributes = "The team Has No Records"
End If
So I have a range with team names and team records, if the strTeamName is a team on this list, I want to store the team record into a string strAttributes. Another factor is that some teams appear multiple times on the list.
Set rngYup = wsNBA.Range("J63:J75")
Do Until rngAttributes.Cells(RowIndex:=intrRow, columnIndex:=1).Value = strTeamName _ Or rngAttributes.Cells(RowIndex:=intrRow, columnIndex:=10).Value = ""
intRow = intRow + 1
Loop
If rngAttributes.Cells(RowIndex:=intrRow, columnIndex:=1).Value = strTeamName Then
For Each cell In rngYup
If cell.Value = strTeamName Then
strAttributes = rngAttributes.Cells(RowIndex:=intRow, columnIndex:=2).Value
intRow = intRow + 1
End If
Next
Else
strAttributes = "The team Has No Records"
End If
So I have a range with team names and team records, if the strTeamName is a team on this list, I want to store the team record into a string strAttributes. Another factor is that some teams appear multiple times on the list.