Hello,
I am trying to create a system consisting of:
- A dropdown menu
- A pivot table
- A chart
The idea is that selecting a field from a Dropdown menu, I change the fields in the pivot table (so it changes its display, let's say from having "clients" in the row labels to "locations") and then I get the data from a certain row of the pivot table to create a chart.
I know how to create pivot tables through VBA, and I know how to refresh them, but I don't know how to control the fields I wish to show in the pivot table. I am sure there might be a way.
I know that I can add fields with this instruction:
So I suppose that "Line of Business" is above "model" in the "Row Labels" box, and the same would be with column labels.
To change the fields, I used the macro recorder and obtained this code:
The problem is that I would like to know the fields I have in the pivot table in order to always keep control of what I have in each part. If this isn't possible, maybe I can just empti the rows/columns field and re-fill them with the fields I want.
I would much appreciate if someone could lend me a hand in this issue.
Bookmarks