I am trying to auto filter datasets pertaining to a set date array which are stored in the UK format - for ex: 11/04/2019 (April 11, 2019), 15/04/2019 (April 15, 2019). The macro is converting the UK date format to US format, however, it is filtering only those dates which are under 12 and is discarding those above 12. The code I used is shown below:
i = 0
For Each iCell In Control.Range(Cells(5, 3), Cells(99, 3))
If iCell.Value <> "" Then
'CONVERT DATE TO US FORMAT FOR VBA
iDte = Format(iCell, "mm/dd/yyyy")
i = i + 2
ReDim Preserve DteAry(1 To i)
DteAry(i - 1) = 2
DteAry(i) = iDte
End If
Next iCell
[Dates to be filtered][1]