Hi, relatively new to VBA Coding.
I'm using Excel 2013, Windows 7
I am trying to build a macro to filter a data Table by a specific date(format dd/mm/yyyy). Within my data Table is a specific column (13) that contains the dates I want to filter by.
When I run my macro it seems to convert the date format into text. For example 23/05/2014 becomes 41782. And returns 0 results.
I believe the issue lies within VBA converting my search date to the US format. I've tried various google searches and differing approaches but have not been successful.
My current code:
Sub FilterByExactDate()
Worksheets("Sheet5").ListObjects("Table1").Range.AutoFilter
Worksheets("Sheet5").ListObjects("Table1").Range.AutoFilter Field:=13, Criteria1:=Worksheets("Sheet2").Range("B9")
End Sub
Please help
I'm using Excel 2013, Windows 7
I am trying to build a macro to filter a data Table by a specific date(format dd/mm/yyyy). Within my data Table is a specific column (13) that contains the dates I want to filter by.
When I run my macro it seems to convert the date format into text. For example 23/05/2014 becomes 41782. And returns 0 results.
I believe the issue lies within VBA converting my search date to the US format. I've tried various google searches and differing approaches but have not been successful.
My current code:
Sub FilterByExactDate()
Worksheets("Sheet5").ListObjects("Table1").Range.AutoFilter
Worksheets("Sheet5").ListObjects("Table1").Range.AutoFilter Field:=13, Criteria1:=Worksheets("Sheet2").Range("B9")
End Sub
Please help