Created
August 29, 2017 08:17
-
-
Save ndthanh/184b9772ae44d07def5e921e350aa39b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
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