leeksleeks
Board Regular
- Joined
- Oct 31, 2013
- Messages
- 96
Hi,
I have a pivot table that when I open it, it will open with a default date. I set the criteria for the dates that I would like to pull data from on 10 pivot tables on the same worksheet. What I would like is to have a macro that creates a pop up box and asks what date I would like information 'from' and 'to'. I have recorded a macro to show what I do. I would like the macro to do this for all pivot tables but only one input at the start with the 'from' and 'to' dates. If the pivot table doesnt exist I would like the macro to move onto the next pivot table. When I look at the code I see that the date is described as a number eg "[Date].[Financial Calendar].[Date].&[5088]", _ is December 1st 2013. I would like to have the option that in the popup box that when it ask for the first date I can write 01/12/2013.
I have had some successful replies to other queries where certain criteria are replaced with the dates replaced with "For i = etc" so can this be done to replace the dates and the number of the pivot tables?
Any help would be gratefully appreciated. Below is the macro I recorded while doing all the criteria I want from my pivot tables.
Cheers
ActiveSheet.PivotTables("PivotTable2").PivotFields( _
"[Date].[Financial Calendar].[Financial Year]").VisibleItemsList = Array("")
ActiveSheet.PivotTables("PivotTable2").PivotFields( _
"[Date].[Financial Calendar].[Financial Half Year]").VisibleItemsList = Array( _
"")
ActiveSheet.PivotTables("PivotTable2").PivotFields( _
"[Date].[Financial Calendar].[Financial Quarter]").VisibleItemsList = Array("")
ActiveSheet.PivotTables("PivotTable2").PivotFields( _
"[Date].[Financial Calendar].[Financial Period]").VisibleItemsList = Array("")
ActiveSheet.PivotTables("PivotTable2").PivotFields( _
"[Date].[Financial Calendar].[Financial Week]").VisibleItemsList = Array("")
ActiveSheet.PivotTables("PivotTable2").PivotFields( _
"[Date].[Financial Calendar].[Date]").VisibleItemsList = Array("", "", _
"[Date].[Financial Calendar].[Date].&[5088]", _
"[Date].[Financial Calendar].[Date].&[5089]", _
"[Date].[Financial Calendar].[Date].&[5090]")
I have a pivot table that when I open it, it will open with a default date. I set the criteria for the dates that I would like to pull data from on 10 pivot tables on the same worksheet. What I would like is to have a macro that creates a pop up box and asks what date I would like information 'from' and 'to'. I have recorded a macro to show what I do. I would like the macro to do this for all pivot tables but only one input at the start with the 'from' and 'to' dates. If the pivot table doesnt exist I would like the macro to move onto the next pivot table. When I look at the code I see that the date is described as a number eg "[Date].[Financial Calendar].[Date].&[5088]", _ is December 1st 2013. I would like to have the option that in the popup box that when it ask for the first date I can write 01/12/2013.
I have had some successful replies to other queries where certain criteria are replaced with the dates replaced with "For i = etc" so can this be done to replace the dates and the number of the pivot tables?
Any help would be gratefully appreciated. Below is the macro I recorded while doing all the criteria I want from my pivot tables.
Cheers
ActiveSheet.PivotTables("PivotTable2").PivotFields( _
"[Date].[Financial Calendar].[Financial Year]").VisibleItemsList = Array("")
ActiveSheet.PivotTables("PivotTable2").PivotFields( _
"[Date].[Financial Calendar].[Financial Half Year]").VisibleItemsList = Array( _
"")
ActiveSheet.PivotTables("PivotTable2").PivotFields( _
"[Date].[Financial Calendar].[Financial Quarter]").VisibleItemsList = Array("")
ActiveSheet.PivotTables("PivotTable2").PivotFields( _
"[Date].[Financial Calendar].[Financial Period]").VisibleItemsList = Array("")
ActiveSheet.PivotTables("PivotTable2").PivotFields( _
"[Date].[Financial Calendar].[Financial Week]").VisibleItemsList = Array("")
ActiveSheet.PivotTables("PivotTable2").PivotFields( _
"[Date].[Financial Calendar].[Date]").VisibleItemsList = Array("", "", _
"[Date].[Financial Calendar].[Date].&[5088]", _
"[Date].[Financial Calendar].[Date].&[5089]", _
"[Date].[Financial Calendar].[Date].&[5090]")