MuppetReaper
New Member
- Joined
- Jun 14, 2013
- Messages
- 30
Hi
I am trying to write some code to update a pivot based on dates in two other cells, all my dates are UK formatted, but I can not get it to work - any ideas please, it's driving me nuts -
the two dates are DateFrom = 25/11/2014 and SatDate = 03/10/2015
I am trying to write some code to update a pivot based on dates in two other cells, all my dates are UK formatted, but I can not get it to work - any ideas please, it's driving me nuts -
the two dates are DateFrom = 25/11/2014 and SatDate = 03/10/2015
Code:
Sub MondayUpdates()
DateFrom = Range("Dates!C16")
SatDate = Range("Dates!C7")
Sheets("Exceptions").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("scan_date_all").PivotFilters. _
Add Type:=xlDateBetween, Value1:=DateFrom, Value2:=SatDate
End Sub