Pivot Table- Show Report Filter & VBA

 

Process Flow to Use "Show Report Filter Pages" and VBA Code for ThisWorkbook.RefreshAll

1. Using "Show Report Filter Pages" in Pivot Tables

This feature allows you to create separate sheets for each filter value in a Pivot Table.

Steps to Use "Show Report Filter Pages":
  1. Select the Pivot Table

    • Click anywhere inside the Pivot Table.
  2. Go to the Analyze/Options Tab (Excel Ribbon)

    • Click PivotTable Analyze (or Options in older versions).
  3. Choose "Show Report Filter Pages"

    • Click "Show Report Filter Pages" under the PivotTable Tools.
  4. Select the Filter Field

    • A dialog box will appear listing all filter fields.
    • Select the field for which you want to create separate sheets.
  5. Click OK

    • Excel will automatically generate a new sheet for each unique value in the selected filter.

2. VBA Code to Refresh All Data (ThisWorkbook.RefreshAll)

To refresh all Pivot Tables, Queries, and External Data in the workbook, use the following VBA code:

VBA Code:
vba
Sub RefreshAllData() ThisWorkbook.RefreshAll MsgBox "All data has been refreshed successfully!", vbInformation, "Refresh Complete" End Sub
Steps to Use the VBA Code:
  1. Open the VBA Editor

    • Press Alt + F11 to open the VBA Editor.
  2. Insert a Module

    • In the VBA Editor, go to Insert → Module.
  3. Paste the Code

    • Copy and paste the above code into the module window.
  4. Run the Macro

    • Press F5 or run the macro RefreshAllData to refresh all data sources.

Comments

Popular posts from this blog

How to Use the FILTER Formula

Using Flash Fill in Excel

Skill Matrix Tool & Excel Format