Hi,
I am using Excel 2010 and have a pivot table which I need to filter using my date range. I have recorded the following which works great.....
ActiveSheet.PivotTables("PivotTable1").PivotFields("Call_Date").PivotFilters. _
Add Type:=xlDateBetween, Value1:="01/05/2011", Value2:="31/05/2011"
However I now want to link Value1 and Value2 to a range on my work sheet but cannot figure out how (or if it's possible?)....have tried the following (and numerous other ways) but it does not work:
ActiveSheet.PivotTables("PivotTable1").PivotFields("Call_Date").PivotFilters. _
Add Type:=xlDateBetween, Value1:=ActiveSheet.Range("C2").value, Value2:=ActiveSheet.Range("C3").value
Can anyone help on this?
Thanks very much
I am using Excel 2010 and have a pivot table which I need to filter using my date range. I have recorded the following which works great.....
ActiveSheet.PivotTables("PivotTable1").PivotFields("Call_Date").PivotFilters. _
Add Type:=xlDateBetween, Value1:="01/05/2011", Value2:="31/05/2011"
However I now want to link Value1 and Value2 to a range on my work sheet but cannot figure out how (or if it's possible?)....have tried the following (and numerous other ways) but it does not work:
ActiveSheet.PivotTables("PivotTable1").PivotFields("Call_Date").PivotFilters. _
Add Type:=xlDateBetween, Value1:=ActiveSheet.Range("C2").value, Value2:=ActiveSheet.Range("C3").value
Can anyone help on this?
Thanks very much