How to set the filters in a Pivotchart through a macro in Excel?

Asked

Viewed 677 times

1

I made a VBA form and wanted to click on a button the filter properties of the dynamic graph associated to a table in Excel if they changed.

  • You need to enable in the Tools -> VBA References in Powerpoint the option Microsoft Excel 16.0 Object Library and create a code that will open the desired Excel file and perform these changes with Excel VBA code. Or if it is a VBA code in Excel, you need to choose which chart (if there is more than one) and make changes to the parameters.

  • What properties do you want to change? And how? With Form in which the user type the parameters or in the Excel cell?

  • A form that I enter the parameters such as start date and end date, or a product code.

  • You can use the autofilter .Autofilter to filter table data. At the beginning of this answer there is an example of how to use autofilter in code for a fixed value. In the example Data, this can be linked with a text field in the form TextBox.

1 answer

0


Why You Don’t Use Data Segmentation for Creating Dashboards?

With data segmentation, you can easily connect and filter multiple tables and dynamic charts without the need to use VBA:

Browser other questions tagged

You are not signed in. Login or sign up in order to post.