我有一张Excel表格,其中包含大约10列和数百行。我想在多列上应用过滤器,只有在满足两列条件时才显示数据。
一列有Team name
,另一列有Team number
。仅当Team name
为"项目" 或 wkFilterTeam 变量和Team number
中的值时,才会显示数据的"的Team2"
Function ProcessTeams(inTeamName As String) As Integer
wkFilterTeam = inTeamName
If (InStr(wkFilterTeam, "Markets") > 0) Then
With Sheets("RawData")
.AutoFilterMode = False
Range("$A:$BG").AutoFilter
Range("$A:$BG").AutoFilter FIELD:=3,
Criteria1:=Array(wkFilterTeam, "Projects"), Operator:=xlFilterValues
Range("$A:$BG").AutoFilter FIELD:=4, Criteria1:=Array("Team2"), Operator:=xlFilterValues
End With
EndIf
End Function
但这显示了所有名为项目且团队编号为 Team2
的团队