Hi Team,
I am trying to apply autofilter on date Column.
Unable to autofilter.
Below is my attempted code.
Below is my data on which I am applying autofilter.
Thanks
mg
I am trying to apply autofilter on date Column.
Unable to autofilter.
Below is my attempted code.
VBA Code:
Sub Date_Filter()
'1) Autofilter not working
ActiveSheet.Range("$B$2:$B$13").AutoFilter Field:=1, Criteria1:=">27/09/2020", Operator:=xlAnd
'2) Autofilter not working
Range("b2").CurrentRegion.AutoFilter Field:=1, Criteria1:=">27/09/2020"
'3) Autofilter not working
With Range("b2").CurrentRegion
.AutoFilter Field:=1, Criteria1:=">27/09/2020", Operator:=xlAnd
End With
'3) Below autofilter works. if I put numbers as Criteria.
'Range("b2").CurrentRegion.AutoFilter Field:=1, Criteria1:=">44101" '">27/09/2020"
End Sub
Below is my data on which I am applying autofilter.
Book2 | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | ||||||
2 | My data | |||||
3 | 26/09/2020 | |||||
4 | 26/09/2020 | |||||
5 | 26/09/2020 | |||||
6 | 26/09/2020 | |||||
7 | 27/09/2020 | |||||
8 | 28/09/2020 | |||||
9 | 29/09/2020 | |||||
10 | 30/09/2020 | |||||
11 | 01/10/2020 | |||||
12 | 02/10/2020 | |||||
13 | 03/10/2020 | |||||
14 | ||||||
Sheet1 |
Thanks
mg