VBA (Excel) filter by date
-
-
Hi all Please help! How to write filter by date in macro in Excel? Automatic generated macro looks like this: Selection.AutoFilter Field:=10, Criteria1:=">=01.01.2007", Operator:=xlAnd, _ Criteria2:="<01.01.2008" But this macro is not working. :( Thanks
Hiiiii Selection.AutoFilter Field:=10, Criteria1:=">=#01.01.2007#", Operator:=xlAnd, _ Criteria2:="<#01.01.2008#" and also check the date format of your system is "dd.mm.yyyy" or "mm.dd.yy" For the comparison with Date use the # character. May be this solve your problem. Thanx Mitesh Khatri khatrimitesh@hotmail.com
modified on Wednesday, June 11, 2008 7:26 AM
-
Hiiiii Selection.AutoFilter Field:=10, Criteria1:=">=#01.01.2007#", Operator:=xlAnd, _ Criteria2:="<#01.01.2008#" and also check the date format of your system is "dd.mm.yyyy" or "mm.dd.yy" For the comparison with Date use the # character. May be this solve your problem. Thanx Mitesh Khatri khatrimitesh@hotmail.com
modified on Wednesday, June 11, 2008 7:26 AM