VBAProIWish
Well-known Member
- Joined
- Jul 6, 2009
- Messages
- 1,027
- Office Version
- 365
- Platform
- Windows
Hello all,
Can someone change the code below so that...
Value 1 = Value from the date in cell "AA2" in the "C" worksheet
Value 2 = Value from the date in cell "AA4" in the "C" worksheet
My "laymens" way of illustrating it would be like this...
PivotFilters.Add2 Type:=xlDateBetween, Value1:=C!AA2, Value2:=C!AA4 <this is what I need code for
Thanks much!
Can someone change the code below so that...
Value 1 = Value from the date in cell "AA2" in the "C" worksheet
Value 2 = Value from the date in cell "AA4" in the "C" worksheet
My "laymens" way of illustrating it would be like this...
PivotFilters.Add2 Type:=xlDateBetween, Value1:=C!AA2, Value2:=C!AA4 <this is what I need code for
VBA Code:
Sheets("Chart 2 MCDB").Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveSheet.PivotTables("PivotTable1").PivotFields("LCD"). _
ClearAllFilters
ActiveSheet.PivotTables("PivotTable1").PivotFields("LCD"). _
PivotFilters.Add2 Type:=xlDateBetween, Value1:="1/1/2020", Value2:="12/31/2020" '<<<this line
Thanks much!