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

ブックからすべてのピボットテーブルを一覧表示するにはどうすればよいですか?

複数のピボットテーブルを含む大きなワークブックがある場合、このワークブックのすべてのピボットテーブルを一覧表示することは可能ですか? もちろん、この記事の次のVBAコードはあなたに有利に働きます。 詳細については、以下の記事をお読みください。

VBAコードを使用してブックからすべてのピボットテーブルを一覧表示します


矢印青い右バブル VBAコードを使用してブックからすべてのピボットテーブルを一覧表示します

次のVBAコードは、すべてのピボットテーブル名を、ソースデータ範囲、ワークシート名、更新された日付などの属性とともに一覧表示するのに役立ちます。

1. すべてのピボットテーブルを一覧表示するブックを開きます。

2。 を押し続けます Alt + F11 キー、そしてそれは開きます Microsoft Visual Basic forApplicationsウィンドウ.

3に設定します。 OK をクリックします。 インセット > モジュール、次のコードをに貼り付けます モジュールウィンドウ.

VBAコード:ブックからすべてのピボットテーブルを一覧表示します

Sub ListPivotsInfor()
'Update 20141112
    Dim St As Worksheet
    Dim NewSt As Worksheet
    Dim pt As PivotTable
    Dim I, K As Long
    Application.ScreenUpdating = False
    Set NewSt = Worksheets.Add
    I = 1: K = 2
    With NewSt
        .Cells(I, 1) = "Name"
        .Cells(I, 2) = "Source"
        .Cells(I, 3) = "Refreshed by"
        .Cells(I, 4) = "Refreshed"
        .Cells(I, 5) = "Sheet"
        .Cells(I, 6) = "Location"
        For Each St In ActiveWorkbook.Worksheets
            For Each pt In St.PivotTables
                I = I + 1
                .Cells(I, 1).Value = pt.Name
                .Cells(I, 2).Value = pt.SourceData
                .Cells(I, 3).Value = pt.RefreshName
                .Cells(I, 4).Value = pt.RefreshDate
                .Cells(I, 5).Value = St.Name
                .Cells(I, 6).Value = pt.TableRange1.Address
            Next
        Next
        .Activate
    End With
    Application.ScreenUpdating = True
End Sub

4。 次に、 F5 このコードを実行するためのキーを押すと、すべてのピボットテーブル名、ソースデータ範囲、ワークシート名、およびその他の属性が、次のスクリーンショットのようにアクティブなワークシートの前に配置された新しいワークシートに一覧表示されます。

doc-list-all-pivottable-1


関連記事:

ピボットテーブルがブックに存在するかどうかを確認するにはどうすればよいですか?

ピボットテーブルに複数のフィールドを追加するにはどうすればよいですか?

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

🤖 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 (20)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
unfortunately I'm getting multiple errors, this would have been absolutely great for my multi-tab, multi-pivot workbooks
This comment was minimized by the moderator on the site
Fit perfeclty!! Thanks a lot
This comment was minimized by the moderator on the site
run time error 1004
This comment was minimized by the moderator on the site
Huge help, saved me a ton of time tracking down one of a number of identically named pivot tables in a Workbook!
This comment was minimized by the moderator on the site
That's Awesome.
This comment was minimized by the moderator on the site
VERY handy to have in a pinch! Thank you.
This comment was minimized by the moderator on the site
Thanks for the post, I cleaned up the code a little by defining I and Long and deleting the ref to K since it wasn't used. Lastly I added a line just below your .Activate to show .Columns.AutoFit
This comment was minimized by the moderator on the site
This is awesome! I have been looking for a code like this one, but with the addition of showing all active fields per table. I need to clean up the source tables from unnecessary fields (too heavy) and they feed a book of over 300 pivots. I'd prefer not to go one pivot table at a time to figure out which fields I can eliminate... If you could show me how, it would be incredible... Thanks!
This comment was minimized by the moderator on the site
Amazing!!! thksss!!!!
This comment was minimized by the moderator on the site
Saved me from a major headache!
Couldn't find what pivot table was causing a "Refresh All Error"
Boom Listed with locations, Thank you so much
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations