Formalization of the comment published for the question:
Trim the value from the pivot table so that Exists work correctly:
For Each person In ActiveSheet.PivotTables(fy).PivotFields("name").PivotItems
If Not memberDic("Team A").Exists(Trim(person.Name)) Then
'hidden person except Team A
End If
Next person
source
share