共用方式為


PivotCache.MissingItemsLimit 屬性 (Excel)

會傳回或設定所保留之各樞紐分析表欄位的最大唯一項目數 (即使在快取記錄中並沒有支援的資料)。 讀取/寫入 XlPivotTableMissingItems

語法

表達。MissingItems限制

代表 PivotCache 物件的變數。

註解

此屬性可以設定為介於 0 到 32,500 之間的值。 如果指定小於零的整數,即等於指定 xlMissingItemsDefault。 若指定大於 32,500 的整數,其效果與指定 xlMissingItemsMax 相同。

MissingItemsLimit 屬性僅適用於非 OLAP 樞紐分析表;否則會發生執行階段錯誤。

範例

本範例將判斷各欄位的最大唯一項目數,並通知使用者。 假設使用中工作表上有一個樞紐分析表。

Sub CheckMissingItemsList() 
 
 Dim pvtCache As PivotCache 
 
 Set pvtCache = Application.ActiveWorkbook.PivotCaches.Item(1) 
 
 ' Determine the maximum number of unique items allowed per PivotField and notify the user. 
 Select Case pvtCache.MissingItemsLimit 
 Case xlMissingItemsDefault 
 MsgBox "The default value of unique items per PivotField is allowed." 
 Case xlMissingItemsMax 
 MsgBox "The maximum value of unique items per PivotField is allowed." 
 Case xlMissingItemsNone 
 MsgBox "No unique items per PivotField are allowed." 
 End Select 
 
End Sub

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應