Forum Discussion
WorkingExcel1100
Feb 23, 2022Copper Contributor
How to filter list after using advanced filter?
Hi, I have managed to extract a particular set of data using advanced data (VBA) but was wondering how can I take it a step further by sorting the extracted data by date with VBA instead of manual da...
NikolinoDE
Feb 23, 2022Platinum Contributor
Maybe as an additional code
ActiveSheet.ListObjects("Table_from_Database ").Range. _
AutoFilter Field:=5, Criteria1:=">=" & CLng(CDate("01.02.2022")), Operator:=xlAnd, Criteria2:="<=" & CLng(CDate("23.02.2022"))
or as a macro
Option Explicit
Sub Filtern()
Dim vDat As Variant
vDat = InputBox( _
prompt:="Date:", _
Default:=Format(Date + 6, "dd.mm.yy"))
If vDat = "" Then Exit Sub
vDat = CDate(vDat)
Range("A1").CurrentRegion.AutoFilter _
field:=3, Criteria1:=">=" & CDbl(vDat)
End Sub
Example file for this macro is included.
I'm not sure if this is what you're looking for, but I hope this may be of some help.
I know I don't know anything (Socrates)