I've encountered a problem in changing Pivot Table Dates as i am not familiar with this, but i think i almost got it, i will attach the printscreen in below to illustrate my issue.
Problems:
1) The first pivot table date selection is in the format as shown per below.
12-Dec-17
2) My button will be executing a function where it will set all the pivotfield's date in different pivot table according to PivotTable1.
3) My VBA code written can only set all the pivot table to the date format as shown per below. (i did attempt to solve this by using custom cells dd-mmm-yy, but it's not working). My code did work, but only shows date format as below, but the data in pivot table is not updated to the date accordingly( after pressing the button).
12/12/2017
4) I have to manually change the date to 12-Dec-17 for all the date in the following pivot tables, so that all the pivot tables can get all the data from the date 12-Dec-17. Currently i failed to do so.
_____________________________________________________________
First of all, i will attach the button code
Secondly, Pictures will be attached with explanations
Problems:
1) The first pivot table date selection is in the format as shown per below.
12-Dec-17
2) My button will be executing a function where it will set all the pivotfield's date in different pivot table according to PivotTable1.
3) My VBA code written can only set all the pivot table to the date format as shown per below. (i did attempt to solve this by using custom cells dd-mmm-yy, but it's not working). My code did work, but only shows date format as below, but the data in pivot table is not updated to the date accordingly( after pressing the button).
12/12/2017
4) I have to manually change the date to 12-Dec-17 for all the date in the following pivot tables, so that all the pivot tables can get all the data from the date 12-Dec-17. Currently i failed to do so.
_____________________________________________________________
First of all, i will attach the button code
Code:
Sub ChgFilter()
DateChoose = ActiveSheet.PivotTables("PivotTable1").PivotFields("Date").CurrentPage
ForEach PT In ActiveSheet.PivotTables
PT.PivotFields("Date").CurrentPage =CDate(DateChoose)
Next
EndSub
Secondly, Pictures will be attached with explanations
- Date must be selected, I will attach the date dropdown list data on the next printscreen.
- Press the button to change the date for other pivot table as i have more than 1 pivot table in below.