excel vba - Filtering with dates working as intended? -


i've been playing around filtering lately , haven't come across trouble until bit involves filtering dates <= specific date. i'm making statement of accounts invoicing code generates monthly statements before end of every month, ie 31/01/2015, 28/02/2015 , on...

i used macro recording copy bit of code:

activesheet.listobjects("tsoa").range.autofilter field:=3, criteria1:= _     "<=31/1/2015", operator:=xland 

and modified accordingly used in table:

.worksheets("soa").autofiltermode = false         tsoa.range.autofilter field:=4, criteria1:=str3         tsoa.range.autofilter field:=8, criteria1:="unpaid"         tsoa.range.autofilter field:=3, criteria1:="<=31/1/2015" 

which features 2 other filters working fine. unfortunately, last date autofilter filters out everything. more puzzling upon inspection of custom date filters, filter in place! , when "refreshed" - ie manually choosing custom date filter under right-click drop down option , pressing ok without changing of inputed values. autofilter works intended!

for more illustration, put stop between first 2 filters , last problematic filter , posted results:

        .worksheets("soa").autofiltermode = false         tsoa.range.autofilter field:=4, criteria1:=str3         tsoa.range.autofilter field:=8, criteria1:="unpaid"          stop          tsoa.range.autofilter field:=3, criteria1:="<=31/1/2015", operator:=xland          stop 

stock data first 2 filters after third problematic filter inspecting custom date filter pressing ok without changing values

does seem know problem? or workaround? i'm thinking if converting dates cdbl values help?


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -