Link Cell Range to Pivot Filter For Date

geekette

Board Regular
Joined
Sep 12, 2006
Messages
120
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
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,224,522
Messages
6,179,292
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