I am looking for assistance with the following VBA code I have written to filter all data in my selected column to be applied to filter more than the single date that it’s giving.
Sub SortDataWithHeader()
ActiveSheet.Range("E1", Range("E1").End(xlDown)).AutoFilter Field:=5, Criteria1:=">=2019-06-17 10:00:00", _
Operator:=xlAnd, Criteria2:="<=2019-06-17 21:00:00"
End Sub
What I would like to achieve is to have the code loop through the data within my selected column, and based on the date portions of Criteria1 and Criteria2, apply the time portion of the Criteria1 and Criteria 2 to all the dates within the selected column.
Following is example of what I am trying to achieve:
[/IMG]
Sub SortDataWithHeader()
ActiveSheet.Range("E1", Range("E1").End(xlDown)).AutoFilter Field:=5, Criteria1:=">=2019-06-17 10:00:00", _
Operator:=xlAnd, Criteria2:="<=2019-06-17 21:00:00"
End Sub
What I would like to achieve is to have the code loop through the data within my selected column, and based on the date portions of Criteria1 and Criteria2, apply the time portion of the Criteria1 and Criteria 2 to all the dates within the selected column.
Following is example of what I am trying to achieve: