Hello all.
I have scratching beneath the surface of Excel for a little while now, but I'm finally stumped and hope to find some help here from someone with a little more knowledge...
I am trying to write a macro that prompts the user to change the date range in a pivot table report. My current code is:
Sheets("Report").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
ActiveSheet.PivotTables("PivotTable1").PivotFields("Date").PivotFilters.Add _
Type:=xlDateBetween, Value1:="05/06/2014", Value2:="04/07/2014"
Is the any way to make the macro stop at the point before Value1 and Value2 entered, or some other way of specifying the date range in advance of running the macro and then utilising the specified dates within the macro?
Any help most appreciated, I have been running around in circles trying to find a solution!
I have scratching beneath the surface of Excel for a little while now, but I'm finally stumped and hope to find some help here from someone with a little more knowledge...
I am trying to write a macro that prompts the user to change the date range in a pivot table report. My current code is:
Sheets("Report").Select
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
ActiveSheet.PivotTables("PivotTable1").PivotFields("Date").PivotFilters.Add _
Type:=xlDateBetween, Value1:="05/06/2014", Value2:="04/07/2014"
Is the any way to make the macro stop at the point before Value1 and Value2 entered, or some other way of specifying the date range in advance of running the macro and then utilising the specified dates within the macro?
Any help most appreciated, I have been running around in circles trying to find a solution!