你可以使用这样的东西:
Sub ListMissingItems()
Dim pt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem
Dim rngList As Range
Dim strMsg As String
' change sheet and range
Set rngList = Worksheets("List").Range("A1:A10")
Set pt = ActiveSheet.PivotTables(1)
' change field as needed
Set pf = pt.PivotFields("Colour")
For Each pi In pf.PivotItems
If IsError(Application.Match(pi.Caption, rngList, 0)) Then strMsg = strMsg & vbLf & pi.Caption
Next pi
If Len(strMsg) > 0 Then MsgBox "The following items were not found in the list:" & strMsg
End Sub
Run Code Online (Sandbox Code Playgroud)