メインコンテンツへスキップ

Excelのピボットテーブルからフィルターキャッシュ(古いアイテム)をクリアするにはどうすればよいですか?

以下のスクリーンショットに示すように、データの範囲に基づいてピボットテーブルを作成します。 ソース範囲からデータを削除した後、ピボットテーブルを更新しても、古いアイテムはピボットテーブルのドロップダウンメニューに残ります。 ピボットテーブルのドロップダウンメニューから古いアイテムをすべて削除する場合は、この記事のメソッドが役立ちます。

オプションを変更して、ピボットテーブルからフィルターキャッシュ(古いアイテム)をクリアします
VBAコードを使用して、すべてのピボットテーブルからフィルターキャッシュ(古いアイテム)をクリアします


オプションを変更して、ピボットテーブルからフィルターキャッシュ(古いアイテム)をクリアします

オプションを変更することで、ピボットテーブルからフィルターキャッシュをクリアできます。 次のようにしてください。

1.ピボットテーブル内の任意のセルを右クリックして、[ ピボットテーブルオプション コンテキストメニューから。 スクリーンショットを参照してください:

2。 の中に ピボットテーブルオプション ダイアログボックスで 且つ タブ、選択 なし フィールドごとに保持するアイテムの数 ドロップダウンリストをクリックし、 OK

3. [ピボットテーブル]セルを右クリックして、[ Refresh 右クリックメニューから。 スクリーンショットを参照してください:

次に、以下のスクリーンショットに示すように、ピボットテーブルのドロップダウンメニューから古いアイテムが削除されていることがわかります。


VBAコードを使用して、すべてのピボットテーブルからフィルターキャッシュ(古いアイテム)をクリアします

アクティブなブック内の複数のワークシートにまたがるすべてのピボットテーブルからフィルターキャッシュをクリアする場合。 以下のVBAスクリプトを試してください。

1.ブックで、すべてのピボットテーブルから古いアイテムをクリアする必要があります。 他の + F11 キーを同時に開いて Microsoft Visual Basic forApplicationsウィンドウ。

2。 の中に アプリケーション向け Microsoft Visual Basic ウィンドウで、ダブルクリックします このワークブック セクションに プロジェクト 開くペイン ThisWorkbook(コード) ウィンドウをクリックし、以下のVBAコードをコピーしてウィンドウに貼り付けます。

VBAコード:アクティブなブック内のすべてのピボットテーブルからフィルターキャッシュ(古いアイテム)をクリアします

Private Sub Workbook_Open()
    Dim xPt As PivotTable
    Dim xWs As Worksheet
    Dim xPc As PivotCache
    Application.ScreenUpdating = False
    For Each xWs In ActiveWorkbook.Worksheets
        For Each xPt In xWs.PivotTables
            xPt.PivotCache.MissingItemsLimit = xlMissingItemsNone
        Next xPt
    Next xWs
    For Each xPc In ActiveWorkbook.PivotCaches
        On Error Resume Next
        xPc.Refresh
    Next xPc
    Application.ScreenUpdating = True
End Sub

3。 プレス F5 キーを押してコードを実行すると、アクティブなブック内のすべてのピボットテーブルのドロップダウンメニューから古いアイテムがすぐに削除されます。


関連記事:

最高のオフィス生産性向上ツール

🤖 Kutools AI アシスタント: 以下に基づいてデータ分析に革命をもたらします。 インテリジェントな実行   |  コードを生成  |  カスタム数式の作成  |  データを分析してグラフを生成する  |  Kutools関数を呼び出す...
人気の機能: 重複を検索、強調表示、または識別する   |  空白行を削除する   |  データを失わずに列またはセルを結合する   |   数式なしのラウンド ...
スーパールックアップ: 複数の基準の VLookup    複数の値の VLookup  |   複数のシートにわたる VLookup   |   ファジールックアップ ....
詳細ドロップダウン リスト: ドロップダウンリストを素早く作成する   |  依存関係のドロップダウン リスト   |  複数選択のドロップダウンリスト ....
列マネージャー: 特定の数の列を追加する  |  列の移動  |  Toggle 非表示列の表示ステータス  |  範囲と列の比較 ...
注目の機能: グリッドフォーカス   |  デザインビュー   |   ビッグフォーミュラバー    ワークブックとシートマネージャー   |  リソースライブラリ (自動テキスト)   |  日付ピッカー   |  ワークシートを組み合わせる   |  セルの暗号化/復号化    リストごとにメールを送信する   |  スーパーフィルター   |   特殊フィルター (太字/斜体/取り消し線をフィルター...) ...
上位 15 のツールセット12 テキスト ツール (テキストを追加, 文字を削除する、...)   |   50+ チャート 種類 (ガントチャート、...)   |   40+ 実用的 (誕生日に基づいて年齢を計算する、...)   |   19 挿入 ツール (QRコードを挿入, パスから画像を挿入、...)   |   12 変換 ツール (数字から言葉へ, 通貨の換算、...)   |   7 マージ&スプリット ツール (高度な結合行, 分割セル、...)   |   ... もっと

Kutools for Excel で Excel スキルを強化し、これまでにない効率を体験してください。 Kutools for Excelは、生産性を向上させ、時間を節約するための300以上の高度な機能を提供します。  最も必要な機能を入手するにはここをクリックしてください...

説明


Officeタブは、タブ付きのインターフェイスをOfficeにもたらし、作​​業をはるかに簡単にします

  • Word、Excel、PowerPointでタブ付きの編集と読み取りを有効にする、パブリッシャー、アクセス、Visioおよびプロジェクト。
  • 新しいウィンドウではなく、同じウィンドウの新しいタブで複数のドキュメントを開いて作成します。
  • 生産性を 50% 向上させ、毎日何百回もマウス クリックを減らすことができます!
Comments (14)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
Hola. Muchisimas gracias, tu ejemplo practico me ayudo mucho y logre resolver el incovenienre.
Me fui por la primera opción, desde la tabla dinamica.
Rated 5 out of 5
This comment was minimized by the moderator on the site
I am facing similar cache issue in my pivot tables and charts created using Power Pivot. Will the above two options works for Pivot Tables created using Power Pivot? Please let me know, if you have any other solution for Power Pivots.
This comment was minimized by the moderator on the site
Hi Manikanta,
The methods provided in this post haven't tested in Power Pivots, sorry I can't help you.
This comment was minimized by the moderator on the site
Thank you Crystal, for the reply. Can anyone suggest other forums to get the solution to remove filter catch for Power Pivot.
This comment was minimized by the moderator on the site
Hi Manikanta,
Maybe you can post your question in our forum. You may get help from others there.
https://www.extendoffice.com/forum/categories/3-excel.html
This comment was minimized by the moderator on the site
You are Awesome!!
Thank you.
This comment was minimized by the moderator on the site
Merci beaucoup ! Depuis le temps que je cherchais à effacer ces caches.... ce n'était pas évident à trouver, voire impossible sans votre aide !
This comment was minimized by the moderator on the site
Thank you!!
This comment was minimized by the moderator on the site
Sir, Thank you very much. it works wonderfully. I was annoyed by this problem. Thanx a lot.
This comment was minimized by the moderator on the site
run time error '1004'... it does not work for me..why?
This comment was minimized by the moderator on the site
Hi mark,
Which Excel version are you using?
This comment was minimized by the moderator on the site
it works, thank you
This comment was minimized by the moderator on the site
It worked for me. Thank you!
This comment was minimized by the moderator on the site
I got a pivot of a table where the filter shows an incorrect value. The analyst name is A in the filter (set retain values to none) but if you go to the table, the same line has the analyst B. If you double click on the line in the pivot table it generates a sheet with the data where the analyst name is B despite the pivot showing A. This table is updated once a month, it worries me because I often do this, update my raw data and update the pivot, now that I have this precedent I cannot trust the information is correct.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations