VBA or Slicer / Power Query - Is it possible to select pivot table fields (column headers)

Sheila8659

New Member
Joined
Mar 1, 2022
Messages
7
Office Version
  1. 365
Platform
  1. Windows
I am working with a price list and would like to select pivot table fields (column headers) based on the price level (PL) selected which is also a column headers. The price level is indicated by Z0 and Z1. This particular column header can be used or not as part of the solution because there is also a helper table located on another sheet being used in PQ to generate calculated columns for other sheets. The helper table can be used and would most likely be a better option if possible. A compiled price list is on still another separate sheet and is the source data for approximately 100 individual pivot tables (one for each group). If code is used, it would need to work on the entire workbook. I have found ways to select rows, but not the column by header name (fields). However, since not everyone on my sales team are excel savvy, I would rather use PQ or a slicer if possible so that the pivot table are easily refreshed.

My objective is to only have only one pivot table for each group that can be toggled by Z0 or Z1 from helper sheet and all pivot tables in the workbook will be refreshed when refresh all is clicked. I have a lot of VBA code and PQ connections in this workbook already, along with images on each of the pivot table sheets. I would like to find a solution that will not interfere with the current progress of the workbook and will be easy to use across all skill levels.

*Note: Not all column headers are listed in the group example due to sensitive information.

Example Description:
Z0 Example: Select Z0 and the fields in the Z0 example are selected.
Z1 Example: Select Z1 and the fields in the Z1 example are selected.
235 Example: A broader view of the end result for each group.
 

Attachments

  • Z0.jpg
    Z0.jpg
    14.9 KB · Views: 9
  • Z1.jpg
    Z1.jpg
    14.7 KB · Views: 9
  • 235 example.jpg
    235 example.jpg
    30.1 KB · Views: 9

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I failed to mention that the current VBA code will only be used internally and will not be distributed as part of the completed price list.
If the columns can be selected from a list that would be great because PQ could then be utilized as part of the solution.
 
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,964
Members
449,094
Latest member
Anshu121

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top