Link to home
Start Free TrialLog in
Avatar of jmkbrown
jmkbrownFlag for United States of America

asked on

Setting the filter value of all pivot tables

I have a spreadsheet with multiple pivot tables on multiple sheets.  Each Monday additional information is added to the data behind the pivot table.  I have created a script that will refresh all of the pivot tables, but I would also like for the script to update the filter value on all pivot tables to the most current date.

Thank you in advance for any help you can provide.
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Are all the pivot tables pointed to the same source?

Will different pivot tables having different most current dates?

How you executed your scripts? By a button or when the workbook is opened?

Do you have a sample to upload for us?
In the data source create a column with a formula that determines whether the data for a particular row is Current or Previous.

In the Pivot Table then filter on Current rather than Date. When the Pivots refresh they will change to valid filter already.
Avatar of jmkbrown

ASKER

Attached is a sample of the spreadsheet.  All tables are pointed to the same source.  They will all need to have the same date.  The script is manually executed.
SampleClass.xlsm
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This worked perfectly!  Thank you very much!