Hi,
I want to filter dates based on set criteria.
Criteria is leave today's date and all other NA dates(01/01/1900) unfiltered. Rest all filter out.
I have attached an example with before and after filtering.
Can it be done with VBA?
Thanks
Hi,
I want to filter dates based on set criteria.
Criteria is leave today's date and all other NA dates(01/01/1900) unfiltered. Rest all filter out.
I have attached an example with before and after filtering.
Can it be done with VBA?
Thanks
try this:
Sub zz() ActiveSheet.Range("a1:a" & [a1048576].End(3).Row).AutoFilter Field:=1, Criteria1:= _ "=0/1/1900", Operator:=xlOr, Criteria2:=Format(Date, "d/m/yyyy") End Sub
Hi ikboy,
The code works. Can you please tell me how do I apply the code if I have data from column A to V and the column to apply filter is V.
Thanks
try this:
Sub zz() i = Columns("V").Column MsgBox Format(Date, "d/m/yyyy") ActiveSheet.Range("a1:v" & [a1048576].End(3).Row).AutoFilter Field:=i, Criteria1:= _ "=0/1/1900", Operator:=xlOr, Criteria2:=Format(Date, "d/m/yyyy") End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks