Yet one more:
Sub Delete_Excluded_Dates()
Dim LastRow As Long, strDate As String, lStart As Long, lEnd As Long
LastRow = Range("F" & Rows.Count).End(xlUp).Row
Do
strDate = Application.InputBox("Enter the start date of your date range in mm/dd/yy format", "Start Date", Type:=2)
If strDate = "False" Then Exit Sub 'User canceled
If IsDate(strDate) Then Exit Do
MsgBox "Invalid date entry. ", , "Invalid Entry"
Loop
lStart = CDate(strDate)
Do
strDate = Application.InputBox("Enter the end date of your date range in mm/dd/yy format", "End Date", Type:=2)
If strDate = "False" Then Exit Sub 'User canceled
If IsDate(strDate) Then Exit Do
MsgBox "Invalid date entry. ", , "Invalid Entry"
Loop
lEnd = CDate(strDate)
Application.ScreenUpdating = False
Range("F1:F" & LastRow).AutoFilter 1, "<" & lStart, xlOr, ">" & lEnd
Range("F2:F" & LastRow).SpecialCells(xlCellTypeVisible).EntireRow.Delete
ActiveSheet.AutoFilterMode = False
Application.ScreenUpdating = True
End Sub
Bookmarks