Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Sub FilterByDateTime()
Dim dDate As Date
Dim dbDate As Double
If IsDate(Range("B1")) Then
dbDate = Range("B1")
dbDate = DateSerial(Year(dbDate), Month(dbDate), Day(dbDate)) + _
TimeSerial(Hour(dbDate), Minute(dbDate), Second(dbDate))
Range("A1").AutoFilter Field:=1, Criteria1:=">" & dbDate
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment