VBA for setting pivot table to show yesterday's data not working

steff.sullivan

New Member
Joined
Aug 18, 2008
Messages
20
I have a raw dataset that updates each day to include the latest day. I have a number of different pivot tables and one is to show a view for the previous day. It is a 2003 workbook although I did create it in 2007.

Based on advice found on google and the Creating Reports for Each Region or Model in MrExcels VBA and Macros for excel 2007 I used this:
PHP:
Sheets("Yday Performance- Agent").PivotTables("PivotTable1").PivotFields("Date").CurrentPage = DateAdd("d", -1, Date)
Unfortunately this does not apepar to be actually filtering but renaming the value already selected in the format 7/18/2011 where the date format for dates is 18/07/2011.

I verified the date format in the regional settings both on my computer and the server which runs the macro daily and both use the UK short date format.

Can anyone help identify why this does not apepar to be working correctly?
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

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