Public Function Played(player, team1, team2)
Dim state As Variant
Dim ref As String
Dim ref1 As String
Dim ref2 As String
ref1 = "A1"
' test cell
Set myRange = Worksheets("Match Results").Range(ref1)
ref2 = GetScores(player, team1, team2)
' function returns the scores "10,11", or "?,?" etc
myRange.Value = ref2
state = Application.WorksheetFunction.Search("~?", myRange.Value)
' state = Application.Evaluate("Search(10, ref)")
If state = "#VALUE!" Then
Played = False
Else
Played = True
End If
End Function
|