please help.. unable to filter arry based on fromdate
Sub test_array()
'Initialise Array
Dim myArray As Variant
myArray = Sheets("Public Holidays").Range("A2:A30").Value ' -- all dates stored in date format i.e. dd-mmm-yy
fromdate = Range("E2").Value '--dd-mm-yy
Z = Filter(myArray, fromdate) '-- error data mismatch
If UBound(Z) > 0 Then ctr = ctr + 1
MsgBox Z
End Sub
Sub test_array()
'Initialise Array
Dim myArray As Variant
myArray = Sheets("Public Holidays").Range("A2:A30").Value ' -- all dates stored in date format i.e. dd-mmm-yy
fromdate = Range("E2").Value '--dd-mm-yy
Z = Filter(myArray, fromdate) '-- error data mismatch
If UBound(Z) > 0 Then ctr = ctr + 1
MsgBox Z
End Sub