Here is my problem:
I have a mastersheet with thousands of data and multiple Headers, and I only need the number of data that meets my criteria in a specific month. My idea was to filter first by the city, because i dont care about the others, but since its a huge sheet and they have data since 2013, and Im only interested in for exemple October,2017. im trying to filter again using the month I need but i just cant do it.
The Date Column is typed by hand and it is in the format dd/mm/yyyy
Sub extract() Dim Font As Workbook Dim Dest As Workbook Set Font = Workbooks("Data.xlsx") Set Dest = Workbooks("MySheet.xlsm") With Font.Worksheets(1) With .Range("A1:V1") .AutoFilter .AutoFilter Field:=10, Criteria1:="City Name" .AutoFilter Field:=19, Criteria1:= 02/10/2017 End With End With End Sub
With this code i can filter by city name, but when i try to do by date it wont work.
If i type the whole date for exemple :
.AutoFilter Field:=19, Criteria1:= 02/10/2017
it shows results, but I dont want it to show only a specific day I want a entire month. So I tried changing the line for this:
.AutoFilter Field:=19, Criteria1:= ??/10/2017 and .AutoFilter Field:=19, Criteria1:= **/10/2017
I also tried changing the date format to mm/dd/yyyy and none of them gave any results, even though they exist
I Looked everywhere and couldnt find a answer to this and thats why im here.
I cant share the data workbook so I tried to be clear as possible but i not sure if it is. Anyway thanks for the help
This filtering processes is only the begging of what im trying to do. If I can pass this step im trying to make so that the Month it will search it will be based by the name of the worksheet. For Exemple if the sheet is named Oct 17 it will filter by the Month October in the year 2017.
This part im not sure if its possible thats why I didnt put in the main question but if you guys have any ideia if its possible ill be thankful if any information is given of how do it