Hey Guys
The code below keeps telling me that the date I entered is not a valid date. I checked the cells and everything matches up. Anyone have an idea of what might be wrong.
The code below keeps telling me that the date I entered is not a valid date. I checked the cells and everything matches up. Anyone have an idea of what might be wrong.
Code:
Sub Macro1()
'
' Macro1 Macro
'
Dim dtStart As Date, dtEnd As Date
With Worksheets("Pivot")
dtStart = Range("E1")
dtEnd = Range("F1")
With .PivotTables("MatDataPvt").PivotFields("MaturityDate")
.ClearAllFilters
.PivotFilters.Add Type:=xlDateBetween, _
Value1:=dtStart, Value2:=dtEnd
End With
End With
End Sub