hi everyone,
i'm trying to sort table by Date.
the code is simple but i don'd get the required result:
'D1 = 01/08/2017![]()
Sub Macro1() Dim D1 As Date D1 = InputBox("Insert date in format dd/mm/yy") Selection.AutoFilter ActiveSheet.Range("$A$1:$F$7").AutoFilter Field:=1, Criteria1:="<D1", Operator:=xlOr, Criteria1:="=D1"
'the table:
header
01/07/2018
01/12/2017
01/08/2017
01/05/2017
01/04/2017
01/01/2017
what i'm doing worng?
thanks.
Bookmarks