Filter Excel Pivot Table based on previous busines

2019-09-20 10:22发布

I'd like to filter an Excel Pivot Table based on the previous business day. I currently filter it dynamically for 'Yesterday', but that does not help on Mondays. Can this be done?

1条回答
小情绪 Triste *
2楼-- · 2019-09-20 10:45

The only way to solve this I can see to write a macro that modifies the date filter in your pivot table. Inside the macro you can easily chech if yesterday was a weekend day to avoid them. You can get familiar with the code you will need by starting a macro recording, changing manually the date, stopping the macro record, and then just open macro code source. Then modify it to analyze the date, and bind the result code to some button. Done.

查看更多
登录 后发表回答